home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / os2 / gnumans.zip / as.inf (.txt) next >
OS/2 Help File  |  1997-07-02  |  192KB  |  4,861 lines

  1.  
  2. ΓòÉΓòÉΓòÉ 1. Title page ΓòÉΓòÉΓòÉ
  3.  
  4.                                     Using as
  5.  
  6.                                 The GNU Assembler
  7.  
  8.                                   January 1994
  9.  
  10. The Free Software Foundation Inc.  thanks The Nice Computer Company of 
  11. Australia for loaning Dean Elsner to write the first (Vax) version of as for 
  12. Project GNU. The proprietors, management and staff of TNCCA thank FSF for 
  13. distracting the boss while they got some work done. 
  14.  
  15.                        Dean Elsner, Jay Fenlason & friends
  16.  
  17. Copyright (C) 1991, 1992, 1993, 1994 Free Software Foundation, Inc. 
  18.  
  19. Permission is granted to make and distribute verbatim copies of this manual 
  20. provided the copyright notice and this permission notice are preserved on all 
  21. copies. 
  22.  
  23. Permission is granted to copy and distribute modified versions of this manual 
  24. under the conditions for verbatim copying, provided that the entire resulting 
  25. derived work is distributed under the terms of a permission notice identical to 
  26. this one. 
  27.  
  28. Permission is granted to copy and distribute translations of this manual into 
  29. another language, under the above conditions for modified versions. 
  30.  
  31.  
  32. ΓòÉΓòÉΓòÉ 2. Top node: "Using as" ΓòÉΓòÉΓòÉ
  33.  
  34. This file is a user guide to the gnu assembler as. 
  35.  
  36.  Overview                                Overview 
  37.  Invoking                                Command-Line Options 
  38.  Syntax                                  Syntax 
  39.  Sections                                Sections and Relocation 
  40.  Symbols                                 Symbols 
  41.  Expressions                             Expressions 
  42.  Pseudo Ops                              Assembler Directives 
  43.  Machine Dependencies                    Machine Dependent Features 
  44.  Acknowledgements                        Who Did What 
  45.  Index                                   Index 
  46.  
  47.  
  48. ΓòÉΓòÉΓòÉ 3. Overview ΓòÉΓòÉΓòÉ
  49.  
  50. Here is a brief summary of how to invoke as.  For details, see Comand-Line 
  51. Options. 
  52.  
  53. as [ -a[dhlns] ] [ -D ] [ -f ] [ -I path ]
  54.  [ -K ] [ -L ] [ -o objfile ] [ -R ]
  55.  [ --statistics] [ -v ] [ -W ] [ -Z ]
  56.  [ -Av6 | -Av7 | -Av8 | -Asparclite | -bump ]
  57.  [ -ACA | -ACA_A | -ACB | -ACC | -AKA | -AKB | -AKC | -AMC ]
  58.  [ -b ] [ -norelax ]
  59.  [ -l ] [ -m68000 | -m68010 | -m68020 | ... ]
  60.  [ -nocpp ] [ -EL ] [ -EB ] [ -G num ]
  61.  [ -mips1 ] [ -mips2 ] [ -mips3 ]
  62.  [ --trap ] [ --break ]
  63.  [ -- | files ... ]
  64.  
  65.  -a[dhlns] 
  66.            Turn on listings, in any of a variety of ways: 
  67.  
  68.            -ad 
  69.                           omit debugging directives from listing 
  70.  
  71.            -ah 
  72.                           include high-level source 
  73.  
  74.            -al 
  75.                           assembly listing 
  76.  
  77.            -an 
  78.                           no forms processing 
  79.  
  80.            -as 
  81.                           symbols 
  82.  
  83.            You may combine these options; for example, use `-aln' for assembly 
  84.            listing without forms processing.  By itself, `-a' defaults to 
  85.            `-ahls'---that is, all listings turned on. 
  86.  
  87.  -D 
  88.            This option is accepted only for script compatibility with calls to 
  89.            other assemblers; it has no effect on as. 
  90.  
  91.  -f 
  92.            ``fast''---skip whitespace and comment preprocessing (assume source 
  93.            is compiler output) 
  94.  
  95.  -I path 
  96.            Add path to the search list for .include directives 
  97.  
  98.  -K 
  99.            Issue warnings when difference tables altered for long 
  100.            displacements. 
  101.  
  102.  -L 
  103.            Keep (in symbol table) local symbols, starting with `L' 
  104.  
  105.  -o objfile 
  106.            Name the object-file output from as 
  107.  
  108.  -R 
  109.            Fold data section into text section 
  110.  
  111.  --statistics 
  112.            Display maximum space (in bytes), and total time (in seconds), taken 
  113.            by assembly. 
  114.  
  115.  -v 
  116.            Announce as version 
  117.  
  118.  -W 
  119.            Suppress warning messages 
  120.  
  121.  -Z 
  122.            Generate object file even after errors 
  123.  
  124.  -- | files ... 
  125.            Standard input, or source files to assemble. 
  126.  
  127.  The following options are available when as is configured for the Intel 80960 
  128.  processor. 
  129.  
  130.  -ACA | -ACA_A | -ACB | -ACC | -AKA | -AKB | -AKC | -AMC 
  131.            Specify which variant of the 960 architecture is the target. 
  132.  
  133.  -b 
  134.            Add code to collect statistics about branches taken. 
  135.  
  136.  -norelax 
  137.            Do not alter compare-and-branch instructions for long displacements; 
  138.            error if necessary. 
  139.  
  140.  The following options are available when as is configured for the Motorola 
  141.  68000 series. 
  142.  
  143.  -l 
  144.            Shorten references to undefined symbols, to one word instead of two. 
  145.  
  146.  -m68000 | -m68008 | -m68010 | -m68020 | -m68030 | -m68040 
  147.  | -m68302 | -m68331 | -m68332 | -m68333 | -m68340 | -mcpu32 
  148.            Specify what processor in the 68000 family is the target.  The 
  149.            default is normally the 68020, but this can be changed at 
  150.            configuration time. 
  151.  
  152.  -m68881 | -m68882 | - mno-68881 | -mno-68882 
  153.            The target machine does (or does not) have a floating-point 
  154.            coprocessor. The default is to assume a coprocessor for 68020, 
  155.            68030, and cpu32.  Although the basic 68000 is not compatible with 
  156.            the 68881, a combination of the two can be specified, since it's 
  157.            possible to do emulation of the coprocessor instructions with the 
  158.            main processor. 
  159.  
  160.  -m68851 | -mno-68851 
  161.            The target machine does (or does not) have a memory-management unit 
  162.            coprocessor.  The default is to assume an MMU for 68020 and up. 
  163.  
  164.  The following options are available when as is configured for the SPARC 
  165.  architecture: 
  166.  
  167.  -Av6 | -Av7 | -Av8 | -Asparclite 
  168.            Explicitly select a variant of the SPARC architecture. 
  169.  
  170.  -bump 
  171.            Warn when the assembler switches to another architecture. 
  172.  
  173.  The following options are available when as is configured for a MIPS 
  174.  processor. 
  175.  
  176.  -G num 
  177.            This option sets the largest size of an object that can be 
  178.            referenced implicitly with the gp register.  It is only accepted for 
  179.            targets that use ECOFF format, such as a DECstation running Ultrix. 
  180.            The default value is 8. 
  181.  
  182.  -EB 
  183.            Generate ``big endian'' format output. 
  184.  
  185.  -EL 
  186.            Generate ``little endian'' format output. 
  187.  
  188.  -mips1 
  189.  -mips2 
  190.  -mips3 
  191.            Generate code for a particular MIPS Instruction Set Architecture 
  192.            level. `-mips1' corresponds to the r2000 and r3000 processors, 
  193.            `-mips2' to the r6000 processor, and `-mips3' to the r4000 
  194.            processor. 
  195.  
  196.  -nocpp 
  197.            as ignores this option.  It is accepted for compatibility with the 
  198.            native tools. 
  199.  
  200.  --trap 
  201.  --no-trap 
  202.  --break 
  203.  --no-break 
  204.            Control how to deal with multiplication overflow and division by 
  205.            zero. `--trap' or `--no-break' (which are synonyms) take a trap 
  206.            exception (and only work for Instruction Set Architecture level 2 
  207.            and higher); `--break' or `--no-trap' (also synonyms, and the 
  208.            default) take a break exception. 
  209.  
  210.  Manual                                  Structure of this Manual 
  211.  GNU Assembler                           AS, the GNU Assembler 
  212.  Object Formats                          Object File Formats 
  213.  Command Line                            Command Line 
  214.  Input Files                             Input Files 
  215.  Object                                  Output (Object) File 
  216.  Errors                                  Error and Warning Messages 
  217.  
  218.  
  219. ΓòÉΓòÉΓòÉ 3.1. Structure of this Manual ΓòÉΓòÉΓòÉ
  220.  
  221. This manual is intended to describe what you need to know to use gnu as.  We 
  222. cover the syntax expected in source files, including notation for symbols, 
  223. constants, and expressions; the directives that as understands; and of course 
  224. how to invoke as. 
  225.  
  226. This manual also describes some of the machine-dependent features of various 
  227. flavors of the assembler. 
  228.  
  229. On the other hand, this manual is not intended as an introduction to 
  230. programming in assembly language---let alone programming in general! In a 
  231. similar vein, we make no attempt to introduce the machine architecture; we do 
  232. not describe the instruction set, standard mnemonics, registers or addressing 
  233. modes that are standard to a particular architecture. You may want to consult 
  234. the manufacturer's machine architecture manual for this information. For 
  235. information on the Hitachi SH machine instruction set, see SH-Microcomputer 
  236. User's Manual (Hitachi Micro Systems, Inc.). For information on the Z8000 
  237. machine instruction set, see Z8000 CPU Technical Manual 
  238.  
  239.  
  240. ΓòÉΓòÉΓòÉ 3.2. as, the GNU Assembler ΓòÉΓòÉΓòÉ
  241.  
  242. gnu as is really a family of assemblers. If you use (or have used) the gnu 
  243. assembler on one architecture, you should find a fairly similar environment 
  244. when you use it on another architecture.  Each version has much in common with 
  245. the others, including object file formats, most assembler directives (often 
  246. called pseudo-ops) and assembler syntax. 
  247.  
  248. as is primarily intended to assemble the output of the gnu C compiler gcc for 
  249. use by the linker ld.  Nevertheless, we've tried to make as assemble correctly 
  250. everything that other assemblers for the same machine would assemble. Any 
  251. exceptions are documented explicitly (see Machine Dependencies). This doesn't 
  252. mean as always uses the same syntax as another assembler for the same 
  253. architecture; for example, we know of several incompatible versions of 680x0 
  254. assembly language syntax. 
  255.  
  256. Unlike older assemblers, as is designed to assemble a source program in one 
  257. pass of the source file.  This has a subtle impact on the .org directive (see 
  258. .org). 
  259.  
  260.  
  261. ΓòÉΓòÉΓòÉ 3.3. Object File Formats ΓòÉΓòÉΓòÉ
  262.  
  263. The gnu assembler can be configured to produce several alternative object file 
  264. formats.  For the most part, this does not affect how you write assembly 
  265. language programs; but directives for debugging symbols are typically different 
  266. in different file formats. See Symbol Attributes. On the machine specific, as 
  267. can be configured to produce either a.out or COFF format object files. On the 
  268. machine specific, as can be configured to produce either b.out or COFF format 
  269. object files. On the machine specific, as can be configured to produce either 
  270. SOM or ELF format object files. 
  271.  
  272.  
  273. ΓòÉΓòÉΓòÉ 3.4. Command Line ΓòÉΓòÉΓòÉ
  274.  
  275. After the program name as, the command line may contain options and file names. 
  276. Options may appear in any order, and may be before, after, or between file 
  277. names.  The order of file names is significant. 
  278.  
  279. `--' (two hyphens) by itself names the standard input file explicitly, as one 
  280. of the files for as to assemble. 
  281.  
  282. Except for `--' any command line argument that begins with a hyphen (`-') is an 
  283. option.  Each option changes the behavior of as.  No option changes the way 
  284. another option works.  An option is a `-' followed by one or more letters; the 
  285. case of the letter is important.  All options are optional. 
  286.  
  287. Some options expect exactly one file name to follow them.  The file name may 
  288. either immediately follow the option's letter (compatible with older 
  289. assemblers) or it may be the next command argument (gnu standard).  These two 
  290. command lines are equivalent: 
  291.  
  292. as -o my-object-file.o mumble.s
  293. as -omy-object-file.o mumble.s
  294.  
  295.  
  296. ΓòÉΓòÉΓòÉ 3.5. Input Files ΓòÉΓòÉΓòÉ
  297.  
  298. We use the phrase source program, abbreviated source, to describe the program 
  299. input to one run of as.  The program may be in one or more files; how the 
  300. source is partitioned into files doesn't change the meaning of the source. 
  301.  
  302. The source program is a concatenation of the text in all the files, in the 
  303. order specified. 
  304.  
  305. Each time you run as it assembles exactly one source program.  The source 
  306. program is made up of one or more files. (The standard input is also a file.) 
  307.  
  308. You give as a command line that has zero or more input file names.  The input 
  309. files are read (from left file name to right).  A command line argument (in any 
  310. position) that has no special meaning is taken to be an input file name. 
  311.  
  312. If you give as no file names it attempts to read one input file from the as 
  313. standard input, which is normally your terminal.  You may have to type ctl-D to 
  314. tell as there is no more program to assemble. 
  315.  
  316. Use `--' if you need to explicitly name the standard input file in your command 
  317. line. 
  318.  
  319. If the source is empty, as produces a small, empty object file. 
  320.  
  321. Filenames and Line-numbers 
  322.  
  323. There are two ways of locating a line in the input file (or files) and either 
  324. may be used in reporting error messages.  One way refers to a line number in a 
  325. physical file; the other refers to a line number in a ``logical'' file.  See 
  326. Error and Warning Messages. 
  327.  
  328. Physical files are those files named in the command line given to as. 
  329.  
  330. Logical files are simply names declared explicitly by assembler directives; 
  331. they bear no relation to physical files.  Logical file names help error 
  332. messages reflect the original source file, when as source is itself synthesized 
  333. from other files. See .app-file. 
  334.  
  335.  
  336. ΓòÉΓòÉΓòÉ 3.6. Output (Object) File ΓòÉΓòÉΓòÉ
  337.  
  338. Every time you run as it produces an output file, which is your assembly 
  339. language program translated into numbers.  This file is the object file.  Its 
  340. default name is a.out, or b.out when as is configured for the Intel 80960. You 
  341. can give it another name by using the -o option.  Conventionally, object file 
  342. names end with `.o'.  The default name is used for historical reasons: older 
  343. assemblers were capable of assembling self-contained programs directly into a 
  344. runnable program.  (For some formats, this isn't currently possible, but it can 
  345. be done for the a.out format.) 
  346.  
  347. The object file is meant for input to the linker ld.  It contains assembled 
  348. program code, information to help ld integrate the assembled program into a 
  349. runnable file, and (optionally) symbolic information for the debugger. 
  350.  
  351.  
  352. ΓòÉΓòÉΓòÉ 3.7. Error and Warning Messages ΓòÉΓòÉΓòÉ
  353.  
  354. as may write warnings and error messages to the standard error file (usually 
  355. your terminal).  This should not happen when  a compiler runs as automatically. 
  356. Warnings report an assumption made so that as could keep assembling a flawed 
  357. program; errors report a grave problem that stops the assembly. 
  358.  
  359. Warning messages have the format 
  360.  
  361. file_name:NNN:Warning Message Text
  362.  
  363. (where NNN is a line number).  If a logical file name has been given (see 
  364. .app-file) it is used for the filename, otherwise the name of the current input 
  365. file is used.  If a logical line number was given (see .line) (see .ln) then it 
  366. is used to calculate the number printed, otherwise the actual line in the 
  367. current source file is printed.  The message text is intended to be self 
  368. explanatory (in the grand Unix tradition). 
  369.  
  370. Error messages have the format 
  371.  
  372. file_name:NNN:FATAL:Error Message Text
  373.  
  374. The file name and line number are derived as for warning messages.  The actual 
  375. message text may be rather less explanatory because many of them aren't 
  376. supposed to happen. 
  377.  
  378.  
  379. ΓòÉΓòÉΓòÉ 4. Command-Line Options ΓòÉΓòÉΓòÉ
  380.  
  381. This chapter describes command-line options available in all versions of the 
  382. gnu assembler; see Machine Dependencies, for options specific to particular 
  383. machine architectures. 
  384.  
  385. If you are invoking as via the gnu C compiler (version 2), you can use the 
  386. `-Wa' option to pass arguments through to the assembler.  The assembler 
  387. arguments must be separated from each other (and the `-Wa') by commas.  For 
  388. example: 
  389.  
  390. gcc -c -g -O -Wa,-alh,-L file.c
  391.  
  392. emits a listing to standard output with high-level and assembly source. 
  393.  
  394. Usually you do not need to use this `-Wa' mechanism, since many compiler 
  395. command-line options are automatically passed to the assembler by the compiler. 
  396. (You can call the gnu compiler driver with the `-v' option to see precisely 
  397. what options it passes to each compilation pass, including the assembler.) 
  398.  
  399.  a                                       -a[dhlns] enable listings 
  400.  D                                       -D for compatibility 
  401.  f                                       -f to work faster 
  402.  I                                       -I for .include search path 
  403.  
  404.  K                                       -K for compatibility 
  405.  
  406.  K                                       -K for difference tables 
  407.  
  408.  L                                       -L to retain local labels 
  409.  o                                       -o to name the object file 
  410.  R                                       -R to join data and text sections 
  411.  statistics                              --statistics to see statistics about 
  412.                                          assembly 
  413.  v                                       -v to announce version 
  414.  W                                       -W to suppress warnings 
  415.  Z                                       -Z to make object file even after 
  416.                                          errors 
  417.  
  418.  
  419. ΓòÉΓòÉΓòÉ 4.1. Enable Listings: -a[dhlns] ΓòÉΓòÉΓòÉ
  420.  
  421. These options enable listing output from the assembler.  By itself, `-a' 
  422. requests high-level, assembly, and symbols listing. You can use other letters 
  423. to select specific options for the list: `-ah' requests a high-level language 
  424. listing, `-al' requests an output-program assembly listing, and `-as' requests 
  425. a symbol table listing. High-level listings require that a compiler debugging 
  426. option like `-g' be used, and that assembly listings (`-al') be requested also. 
  427.  
  428. Use the `-ad' option to omit debugging directives from the listing. 
  429.  
  430. Once you have specified one of these options, you can further control listing 
  431. output and its appearance using the directives .list, .nolist, .psize, .eject, 
  432. .title, and .sbttl. The `-an' option turns off all forms processing. If you do 
  433. not request listing output with one of the `-a' options, the listing-control 
  434. directives have no effect. 
  435.  
  436. The letters after `-a' may be combined into one option, e.g., `-aln'. 
  437.  
  438.  
  439. ΓòÉΓòÉΓòÉ 4.2. -D ΓòÉΓòÉΓòÉ
  440.  
  441. This option has no effect whatsoever, but it is accepted to make it more likely 
  442. that scripts written for other assemblers also work with as. 
  443.  
  444.  
  445. ΓòÉΓòÉΓòÉ 4.3. Work Faster: -f ΓòÉΓòÉΓòÉ
  446.  
  447. `-f' should only be used when assembling programs written by a (trusted) 
  448. compiler.  `-f' stops the assembler from doing whitespace and comment 
  449. preprocessing on the input file(s) before assembling them. See Preprocessing. 
  450.  
  451. Warning: if you use `-f' when the files actually need to be preprocessed (if 
  452. they contain comments, for example), as does not work correctly. 
  453.  
  454.  
  455. ΓòÉΓòÉΓòÉ 4.4. .include search path: -I path ΓòÉΓòÉΓòÉ
  456.  
  457. Use this option to add a path to the list of directories as searches for files 
  458. specified in .include directives (see .include).  You may use -I as many times 
  459. as necessary to include a variety of paths.  The current working directory is 
  460. always searched first; after that, as searches any `-I' directories in the same 
  461. order as they were specified (left to right) on the command line. 
  462.  
  463.  
  464. ΓòÉΓòÉΓòÉ 4.5. Difference Tables: -K ΓòÉΓòÉΓòÉ
  465.  
  466. as sometimes alters the code emitted for directives of the form `.word 
  467. sym1-sym2'; see .word. You can use the `-K' option if you want a warning issued 
  468. when this is done. 
  469.  
  470.  
  471. ΓòÉΓòÉΓòÉ 4.6. Include Local Labels: -L ΓòÉΓòÉΓòÉ
  472.  
  473. Labels beginning with `L' (upper case only) are called local labels. See Symbol 
  474. Names.  Normally you do not see such labels when debugging, because they are 
  475. intended for the use of programs (like compilers) that compose assembler 
  476. programs, not for your notice. Normally both as and ld discard such labels, so 
  477. you do not normally debug with them. 
  478.  
  479. This option tells as to retain those `L...' symbols in the object file. 
  480. Usually if you do this you also tell the linker ld to preserve symbols whose 
  481. names begin with `L'. 
  482.  
  483. By default, a local label is any label beginning with `L', but each target is 
  484. allowed to redefine the local label prefix. On the HPPA local labels begin with 
  485. `L$'. 
  486.  
  487.  
  488. ΓòÉΓòÉΓòÉ 4.7. Name the Object File: -o ΓòÉΓòÉΓòÉ
  489.  
  490. There is always one object file output when you run as.  By default it has the 
  491. name `a.out' (or `b.out', for Intel 960 targets only). You use this option 
  492. (which takes exactly one filename) to give the object file a different name. 
  493.  
  494. Whatever the object file is called, as overwrites any existing file of the same 
  495. name. 
  496.  
  497.  
  498. ΓòÉΓòÉΓòÉ 4.8. Join Data and Text Sections: -R ΓòÉΓòÉΓòÉ
  499.  
  500. -R tells as to write the object file as if all data-section data lives in the 
  501. text section.  This is only done at the very last moment:  your binary data are 
  502. the same, but data section parts are relocated differently.  The data section 
  503. part of your object file is zero bytes long because all its bytes are appended 
  504. to the text section.  (See Sections and Relocation.) 
  505.  
  506. When you specify -R it would be possible to generate shorter address 
  507. displacements (because we do not have to cross between text and data section). 
  508. We refrain from doing this simply for compatibility with older versions of as. 
  509. In future, -R may work this way. 
  510.  
  511. When as is configured for COFF output, this option is only useful if you use 
  512. sections named `.text' and `.data'. 
  513.  
  514. -R is not supported for any of the HPPA targets.  Using -R generates a warning 
  515. from as. 
  516.  
  517.  
  518. ΓòÉΓòÉΓòÉ 4.9. Display Assembly Statistics: --statistics ΓòÉΓòÉΓòÉ
  519.  
  520. Use `--statistics' to display two statistics about the resources used by as: 
  521. the maximum amount of space allocated during the assembly (in bytes), and the 
  522. total execution time taken for the assembly (in cpu seconds). 
  523.  
  524.  
  525. ΓòÉΓòÉΓòÉ 4.10. Announce Version: -v ΓòÉΓòÉΓòÉ
  526.  
  527. You can find out what version of as is running by including the option `-v' 
  528. (which you can also spell as `-version') on the command line. 
  529.  
  530.  
  531. ΓòÉΓòÉΓòÉ 4.11. Suppress Warnings: -W ΓòÉΓòÉΓòÉ
  532.  
  533. as should never give a warning or error message when assembling compiler 
  534. output.  But programs written by people often cause as to give a warning that a 
  535. particular assumption was made.  All such warnings are directed to the standard 
  536. error file. If you use this option, no warnings are issued.  This option only 
  537. affects the warning messages: it does not change any particular of how as 
  538. assembles your file.  Errors, which stop the assembly, are still reported. 
  539.  
  540.  
  541. ΓòÉΓòÉΓòÉ 4.12. Generate Object File in Spite of Errors: -Z ΓòÉΓòÉΓòÉ
  542.  
  543. After an error message, as normally produces no output.  If for some reason you 
  544. are interested in object file output even after as gives an error message on 
  545. your program, use the `-Z' option.  If there are any errors, as continues 
  546. anyways, and writes an object file after a final warning message of the form `n 
  547. errors, m warnings, generating bad object file.' 
  548.  
  549.  
  550. ΓòÉΓòÉΓòÉ 5. Syntax ΓòÉΓòÉΓòÉ
  551.  
  552. This chapter describes the machine-independent syntax allowed in a source file. 
  553. as syntax is similar to what many other assemblers use; it is inspired by the 
  554. BSD 4.2 assembler, except that as does not assemble Vax bit-fields. 
  555.  
  556.  Preprocessing                           Preprocessing 
  557.  Whitespace                              Whitespace 
  558.  Comments                                Comments 
  559.  Symbol Intro                            Symbols 
  560.  Statements                              Statements 
  561.  Constants                               Constants 
  562.  
  563.  
  564. ΓòÉΓòÉΓòÉ 5.1. Preprocessing ΓòÉΓòÉΓòÉ
  565.  
  566. The as internal preprocessor: 
  567.  
  568.      adjusts and removes extra whitespace.  It leaves one space or tab before 
  569.       the keywords on a line, and turns any other whitespace on the line into a 
  570.       single space. 
  571.  
  572.      removes all comments, replacing them with a single space, or an 
  573.       appropriate number of newlines. 
  574.  
  575.      converts character constants into the appropriate numeric values. 
  576.  
  577.  It does not do macro processing, include file handling, or anything else you 
  578.  may get from your C compiler's preprocessor.  You can do include file 
  579.  processing with the .include directive (see .include).  You can use the gnu C 
  580.  compiler driver to get other ``CPP'' style preprocessing, by giving the input 
  581.  file a `.S' suffix. See Options Controlling the Kind of Output. 
  582.  
  583.  Excess whitespace, comments, and character constants cannot be used in the 
  584.  portions of the input text that are not preprocessed. 
  585.  
  586.  If the first line of an input file is #NO_APP or if you use the `-f' option, 
  587.  whitespace and comments are not removed from the input file. Within an input 
  588.  file, you can ask for whitespace and comment removal in specific portions of 
  589.  the by putting a line that says #APP before the text that may contain 
  590.  whitespace or comments, and putting a line that says #NO_APP after this text. 
  591.  This feature is mainly intend to support asm statements in compilers whose 
  592.  output is otherwise free of comments and whitespace. 
  593.  
  594.  
  595. ΓòÉΓòÉΓòÉ 5.2. Whitespace ΓòÉΓòÉΓòÉ
  596.  
  597. Whitespace is one or more blanks or tabs, in any order. Whitespace is used to 
  598. separate symbols, and to make programs neater for people to read.  Unless 
  599. within character constants (see Character Constants), any whitespace means the 
  600. same as exactly one space. 
  601.  
  602.  
  603. ΓòÉΓòÉΓòÉ 5.3. Comments ΓòÉΓòÉΓòÉ
  604.  
  605. There are two ways of rendering comments to as.  In both cases the comment is 
  606. equivalent to one space. 
  607.  
  608. Anything from `/*' through the next `*/' is a comment. This means you may not 
  609. nest these comments. 
  610.  
  611. /*
  612.   The only way to include a newline ('\n') in a comment
  613.   is to use this sort of comment.
  614. */
  615.  
  616. /* This sort of comment does not nest. */
  617.  
  618. Anything from the line comment character to the next newline is considered a 
  619. comment and is ignored.  The line comment character is `#' on the Vax; `#' on 
  620. the i960; `!' on the SPARC; `|' on the 680x0; `;' for the AMD 29K family; `;' 
  621. for the H8/300 family; `!' for the H8/500 family; `;' for the HPPA; `!' for the 
  622. Hitachi SH; `!' for the Z8000; see Machine Dependencies. 
  623.  
  624. On some machines there are two different line comment characters.  One 
  625. character only begins a comment if it is the first non-whitespace character on 
  626. a line, while the other always begins a comment. 
  627.  
  628. To be compatible with past assemblers, lines that begin with `#' have a special 
  629. interpretation.  Following the `#' should be an absolute expression (see 
  630. Expressions): the logical line number of the next line.  Then a string (see 
  631. Strings) is allowed: if present it is a new logical file name.  The rest of the 
  632. line, if any, should be whitespace. 
  633.  
  634. If the first non-whitespace characters on the line are not numeric, the line is 
  635. ignored.  (Just like a comment.) 
  636.  
  637.                           # This is an ordinary comment.
  638. # 42-6 "new_file_name"    # New logical file name
  639.                           # This is logical line # 36.
  640.  
  641. This feature is deprecated, and may disappear from future versions of as. 
  642.  
  643.  
  644. ΓòÉΓòÉΓòÉ 5.4. Symbols ΓòÉΓòÉΓòÉ
  645.  
  646. A symbol is one or more characters chosen from the set of all letters (both 
  647. upper and lower case), digits and the three characters `_.$'. On most machines, 
  648. you can also use $ in symbol names; exceptions are noted in Machine 
  649. Dependencies. No symbol may begin with a digit.  Case is significant. There is 
  650. no length limit: all characters are significant.  Symbols are delimited by 
  651. characters not in that set, or by the beginning of a file (since the source 
  652. program must end with a newline, the end of a file is not a possible symbol 
  653. delimiter).  See Symbols. 
  654.  
  655.  
  656. ΓòÉΓòÉΓòÉ 5.5. Statements ΓòÉΓòÉΓòÉ
  657.  
  658. A statement ends at a newline character (`\n') or an exclamation point (`!'). 
  659. The newline or exclamation point is considered part of the preceding statement. 
  660. Newlines and exclamation points within character constants are an exception: 
  661. they do not end statements. A statement ends at a newline character (`\n'); or 
  662. (for the H8/300) a dollar sign (`$'); or (for the Hitachi-SH or the H8/500) a 
  663. semicolon (`;').  The newline or separator character is considered part of the 
  664. preceding statement.  Newlines and separators within character constants are an 
  665. exception: they do not end statements. A statement ends at a newline character 
  666. (`\n') or line separator character.  (The line separator is usually `;', unless 
  667. this conflicts with the comment character; see Machine Dependencies.)  The 
  668. newline or separator character is considered part of the preceding statement. 
  669. Newlines and separators within character constants are an exception: they do 
  670. not end statements. 
  671.  
  672. It is an error to end any statement with end-of-file:  the last character of 
  673. any input file should be a newline. 
  674.  
  675. You may write a statement on more than one line if you put a backslash (\) 
  676. immediately in front of any newlines within the statement.  When as reads a 
  677. backslashed newline both characters are ignored.  You can even put backslashed 
  678. newlines in the middle of symbol names without changing the meaning of your 
  679. source program. 
  680.  
  681. An empty statement is allowed, and may include whitespace.  It is ignored. 
  682.  
  683. A statement begins with zero or more labels, optionally followed by a key 
  684. symbol which determines what kind of statement it is.  The key symbol 
  685. determines the syntax of the rest of the statement.  If the symbol begins with 
  686. a dot `.' then the statement is an assembler directive: typically valid for any 
  687. computer.  If the symbol begins with a letter the statement is an assembly 
  688. language instruction: it assembles into a machine language instruction. 
  689. Different versions of as for different computers recognize different 
  690. instructions.  In fact, the same symbol may represent a different instruction 
  691. in a different computer's assembly language. 
  692.  
  693. A label is a symbol immediately followed by a colon (:). Whitespace before a 
  694. label or after a colon is permitted, but you may not have whitespace between a 
  695. label's symbol and its colon. See Labels. 
  696.  
  697. For HPPA targets, labels need not be immediately followed by a colon, but the 
  698. definition of a label must begin in column zero.  This also implies that only 
  699. one label may be defined on each line. 
  700.  
  701. label:     .directive    followed by something
  702. another_label:           # This is an empty statement.
  703.            instruction   operand_1, operand_2, ...
  704.  
  705.  
  706. ΓòÉΓòÉΓòÉ 5.6. Constants ΓòÉΓòÉΓòÉ
  707.  
  708. A constant is a number, written so that its value is known by inspection, 
  709. without knowing any context.  Like this: 
  710.  
  711. .byte  74, 0112, 092, 0x4A, 0X4a, 'J, '\J # All the same value.
  712. .ascii "Ring the bell\7"                  # A string constant.
  713. .octa  0x123456789abcdef0123456789ABCDEF0 # A bignum.
  714. .float 0f-314159265358979323846264338327\
  715. 95028841971.693993751E-40                 # - pi, a flonum.
  716.  
  717.  Characters                              Character Constants 
  718.  Numbers                                 Number Constants 
  719.  
  720.  
  721. ΓòÉΓòÉΓòÉ 5.6.1. Character Constants ΓòÉΓòÉΓòÉ
  722.  
  723. There are two kinds of character constants.  A character stands for one 
  724. character in one byte and its value may be used in numeric expressions.  String 
  725. constants (properly called string literals) are potentially many bytes and 
  726. their values may not be used in arithmetic expressions. 
  727.  
  728.  Strings                                 Strings 
  729.  Chars                                   Characters 
  730.  
  731.  
  732. ΓòÉΓòÉΓòÉ 5.6.1.1. Strings ΓòÉΓòÉΓòÉ
  733.  
  734. A string is written between double-quotes.  It may contain double-quotes or 
  735. null characters.  The way to get special characters into a string is to escape 
  736. these characters: precede them with a backslash `\' character.  For example 
  737. `\\' represents one backslash:  the first \ is an escape which tells as to 
  738. interpret the second character literally as a backslash (which prevents as from 
  739. recognizing the second \ as an escape character).  The complete list of escapes 
  740. follows. 
  741.  
  742.  \b 
  743.            Mnemonic for backspace; for ASCII this is octal code 010. 
  744.  
  745.  \f 
  746.            Mnemonic for FormFeed; for ASCII this is octal code 014. 
  747.  
  748.  \n 
  749.            Mnemonic for newline; for ASCII this is octal code 012. 
  750.  
  751.  \r 
  752.            Mnemonic for carriage-Return; for ASCII this is octal code 015. 
  753.  
  754.  \t 
  755.            Mnemonic for horizontal Tab; for ASCII this is octal code 011. 
  756.  
  757.  \ digit digit digit 
  758.            An octal character code.  The numeric code is 3 octal digits. For 
  759.            compatibility with other Unix systems, 8 and 9 are accepted as 
  760.            digits: for example, \008 has the value 010, and \009 the value 011. 
  761.  
  762.  \x hex-digit hex-digit 
  763.            A hex character code.  The numeric code is 2 hexadecimal digits. 
  764.            Either upper or lower case x works. 
  765.  
  766.  \\ 
  767.            Represents one `\' character. 
  768.  
  769.  \" 
  770.            Represents one `"' character.  Needed in strings to represent this 
  771.            character, because an unescaped `"' would end the string. 
  772.  
  773.  \ anything-else 
  774.            Any other character when escaped by \ gives a warning, but assembles 
  775.            as if the `\' was not present.  The idea is that if you used an 
  776.            escape sequence you clearly didn't want the literal interpretation 
  777.            of the following character.  However as has no other interpretation, 
  778.            so as knows it is giving you the wrong code and warns you of the 
  779.            fact. 
  780.  
  781.  Which characters are escapable, and what those escapes represent, varies 
  782.  widely among assemblers.  The current set is what we think the BSD 4.2 
  783.  assembler recognizes, and is a subset of what most C compilers recognize.  If 
  784.  you are in doubt, do not use an escape sequence. 
  785.  
  786.  
  787. ΓòÉΓòÉΓòÉ 5.6.1.2. Characters ΓòÉΓòÉΓòÉ
  788.  
  789. A single character may be written as a single quote immediately followed by 
  790. that character.  The same escapes apply to characters as to strings.  So if you 
  791. want to write the character backslash, you must write '\\ where the first \ 
  792. escapes the second \.  As you can see, the quote is an acute accent, not a 
  793. grave accent.  A newline (or dollar sign `$', for the H8/300; or semicolon `;' 
  794. for the Hitachi SH or H8/500) immediately following an acute accent is taken as 
  795. a literal character and does not count as the end of a statement.  The value of 
  796. a character constant in a numeric expression is the machine's byte-wide code 
  797. for that character.  as assumes your character code is ASCII: 'A means 65, 'B 
  798. means 66, and so on. 
  799.  
  800.  
  801. ΓòÉΓòÉΓòÉ 5.6.2. Number Constants ΓòÉΓòÉΓòÉ
  802.  
  803. as distinguishes three kinds of numbers according to how they are stored in the 
  804. target machine.  Integers are numbers that would fit into an int in the C 
  805. language.  Bignums are integers, but they are stored in more than 32 bits. 
  806. Flonums are floating point numbers, described below. 
  807.  
  808.  Integers                                Integers 
  809.  Bignums                                 Bignums 
  810.  Flonums                                 Flonums 
  811.  
  812.  Bit Fields                              Bit Fields 
  813.  
  814.  
  815. ΓòÉΓòÉΓòÉ 5.6.2.1. Integers ΓòÉΓòÉΓòÉ
  816.  
  817. A binary integer is `0b' or `0B' followed by zero or more of the binary digits 
  818. `01'. 
  819.  
  820. An octal integer is `0' followed by zero or more of the octal digits 
  821. (`01234567'). 
  822.  
  823. A decimal integer starts with a non-zero digit followed by zero or more digits 
  824. (`0123456789'). 
  825.  
  826. A hexadecimal integer is `0x' or `0X' followed by one or more hexadecimal 
  827. digits chosen from `0123456789abcdefABCDEF'. 
  828.  
  829. Integers have the usual values.  To denote a negative integer, use the prefix 
  830. operator `-' discussed under expressions (see Prefix Operators). 
  831.  
  832.  
  833. ΓòÉΓòÉΓòÉ 5.6.2.2. Bignums ΓòÉΓòÉΓòÉ
  834.  
  835. A bignum has the same syntax and semantics as an integer except that the number 
  836. (or its negative) takes more than 32 bits to represent in binary.  The 
  837. distinction is made because in some places integers are permitted while bignums 
  838. are not. 
  839.  
  840.  
  841. ΓòÉΓòÉΓòÉ 5.6.2.3. Flonums ΓòÉΓòÉΓòÉ
  842.  
  843. A flonum represents a floating point number.  The translation is indirect: a 
  844. decimal floating point number from the text is converted by as to a generic 
  845. binary floating point number of more than sufficient precision.  This generic 
  846. floating point number is converted to a particular computer's floating point 
  847. format (or formats) by a portion of as specialized to that computer. 
  848.  
  849. A flonum is written by writing (in order) 
  850.  
  851.      The digit `0'. (`0' is optional on the HPPA.) 
  852.  
  853.      A letter, to tell as the rest of the number is a flonum. e is 
  854.       recommended.  Case is not important. 
  855.  
  856.       On the H8/300, H8/500, Hitachi SH, and AMD 29K architectures, the letter 
  857.       must be one of the letters `DFPRSX' (in upper or lower case). 
  858.  
  859.       On the Intel 960 architecture, the letter must be one of the letters 
  860.       `DFT' (in upper or lower case). 
  861.  
  862.       On the HPPA architecture, the letter must be `E' (upper case only). One 
  863.       of the letters `DFT' (in upper or lower case). The letter `E' (upper case 
  864.       only). 
  865.  
  866.      An optional sign: either `+' or `-'. 
  867.  
  868.      An optional integer part: zero or more decimal digits. 
  869.  
  870.      An optional fractional part: `.' followed by zero or more decimal digits. 
  871.  
  872.      An optional exponent, consisting of: 
  873.  
  874.         -  An `E' or `e'. 
  875.  
  876.         -  Optional sign: either `+' or `-'. 
  877.  
  878.         -  One or more decimal digits. 
  879.  
  880.  At least one of the integer part or the fractional part must be present.  The 
  881.  floating point number has the usual base-10 value. 
  882.  
  883.  as does all processing using integers.  Flonums are computed independently of 
  884.  any floating point hardware in the computer running as. into a field whose 
  885.  width depends on which assembler directive has the 
  886.  
  887.  bit-field as its argument.  Overflow (a result from the bitwise and requiring 
  888.  more binary digits to represent) is not an error; instead, more constants are 
  889.  generated, of the specified width, beginning with the least significant 
  890.  digits. 
  891.  
  892.  The directives .byte, .hword, .int, .long, .short, and .word accept bit-field 
  893.  arguments. 
  894.  
  895.  
  896. ΓòÉΓòÉΓòÉ 6. Sections and Relocation ΓòÉΓòÉΓòÉ
  897.  
  898.  Secs Background                         Background 
  899.  Ld Sections                             LD Sections 
  900.  As Sections                             AS Internal Sections 
  901.  Sub-Sections                            Sub-Sections 
  902.  bss                                     bss Section 
  903.  
  904.  
  905. ΓòÉΓòÉΓòÉ 6.1. Background ΓòÉΓòÉΓòÉ
  906.  
  907. Roughly, a section is a range of addresses, with no gaps; all data ``in'' those 
  908. addresses is treated the same for some particular purpose. For example there 
  909. may be a ``read only'' section. 
  910.  
  911. The linker ld reads many object files (partial programs) and combines their 
  912. contents to form a runnable program.  When as emits an object file, the partial 
  913. program is assumed to start at address 0. ld assigns the final addresses for 
  914. the partial program, so that different partial programs do not overlap.  This 
  915. is actually an oversimplification, but it suffices to explain how as uses 
  916. sections. 
  917.  
  918. ld moves blocks of bytes of your program to their run-time addresses.  These 
  919. blocks slide to their run-time addresses as rigid units; their length does not 
  920. change and neither does the order of bytes within them.  Such a rigid unit is 
  921. called a section.  Assigning run-time addresses to sections is called 
  922. relocation.  It includes the task of adjusting mentions of object-file 
  923. addresses so they refer to the proper run-time addresses. For the H8/300 and 
  924. H8/500, and for the Hitachi SH, as pads sections if needed to ensure they end 
  925. on a word (sixteen bit) boundary. 
  926.  
  927. An object file written by as has at least three sections, any of which may be 
  928. empty.  These are named text, data and bss sections. 
  929.  
  930. When it generates COFF output, as can also generate whatever other named 
  931. sections you specify using the `.section' directive (see .section). If you do 
  932. not use any directives that place output in the `.text' or `.data' sections, 
  933. these sections still exist, but are empty. 
  934.  
  935. When as generates SOM or ELF output for the HPPA, as can also generate whatever 
  936. other named sections you specify using the `.space' and `.subspace' directives. 
  937. See HP9000 Series 800 Assembly Language Reference Manual (HP 92432-90001) for 
  938. details on the `.space' and `.subspace' assembler directives. 
  939.  
  940. Additionally, as uses different names for the standard text, data, and bss 
  941. sections when generating SOM output.  Program text is placed into the `$CODE$' 
  942. section, data into `$DATA$', and BSS into `$BSS$'. 
  943.  
  944. Within the object file, the text section starts at address 0, the data section 
  945. follows, and the bss section follows the data section. 
  946.  
  947. When generating either SOM or ELF output files on the HPPA, the text section 
  948. starts at address 0, the data section at address 0x4000000, and the bss section 
  949. follows the data section. 
  950.  
  951. To let ld know which data changes when the sections are relocated, and how to 
  952. change that data, as also writes to the object file details of the relocation 
  953. needed.  To perform relocation ld must know, each time an address in the object 
  954. file is mentioned: 
  955.  
  956.      Where in the object file is the beginning of this reference to an 
  957.       address? 
  958.  
  959.      How long (in bytes) is this reference? 
  960.  
  961.      Which section does the address refer to?  What is the numeric value of 
  962.  
  963.             (address) - (start-address of section)?
  964.  
  965.      Is the reference to an address ``Program-Counter relative''? 
  966.  
  967.  In fact, every address as ever uses is expressed as 
  968.  
  969.   (section) + (offset into section)
  970.  Further, most expressions as computes have this section-relative nature. (For 
  971.  some object formats, such as SOM for the HPPA, some expressions are 
  972.  symbol-relative instead.) 
  973.  
  974.  In this manual we use the notation {secname N } to mean ``offset N into 
  975.  section secname.'' 
  976.  
  977.  Apart from text, data and bss sections you need to know about the absolute 
  978.  section.  When ld mixes partial programs, addresses in the absolute section 
  979.  remain unchanged.  For example, address {absolute 0} is ``relocated'' to 
  980.  run-time address 0 by ld.  Although the linker never arranges two partial 
  981.  programs' data sections with overlapping addresses after linking, by 
  982.  definition their absolute sections must overlap.  Address {absolute@ 239} in 
  983.  one part of a program is always the same address when the program is running 
  984.  as address {absolute@ 239} in any other part of the program. 
  985.  
  986.  The idea of sections is extended to the undefined section.  Any address whose 
  987.  section is unknown at assembly time is by definition rendered {undefined 
  988.  U}---where U is filled in later. Since numbers are always defined, the only 
  989.  way to generate an undefined address is to mention an undefined symbol.  A 
  990.  reference to a named common block would be such a symbol: its value is unknown 
  991.  at assembly time so it has section undefined. 
  992.  
  993.  By analogy the word section is used to describe groups of sections in the 
  994.  linked program.  ld puts all partial programs' text sections in contiguous 
  995.  addresses in the linked program.  It is customary to refer to the text section 
  996.  of a program, meaning all the addresses of all partial programs' text 
  997.  sections.  Likewise for data and bss sections. 
  998.  
  999.  Some sections are manipulated by ld; others are invented for use of as and 
  1000.  have no meaning except during assembly. 
  1001.  
  1002.  
  1003. ΓòÉΓòÉΓòÉ 6.2. ld Sections ΓòÉΓòÉΓòÉ
  1004.  
  1005. ld deals with just four kinds of sections, summarized below. 
  1006.  
  1007.  *named sections* 
  1008.  *text section* 
  1009.  *data section* 
  1010.            These sections hold your program.  as and ld treat them as separate 
  1011.            but equal sections.  Anything you can say of one section is true 
  1012.            another. When the program is running, however, it is customary for 
  1013.            the text section to be unalterable.  The text section is often 
  1014.            shared among processes: it contains instructions, constants and the 
  1015.            like.  The data section of a running program is usually alterable: 
  1016.            for example, C variables would be stored in the data section. 
  1017.  
  1018.  *bss section* 
  1019.            This section contains zeroed bytes when your program begins running. 
  1020.            It is used to hold unitialized variables or common storage.  The 
  1021.            length of each partial program's bss section is important, but 
  1022.            because it starts out containing zeroed bytes there is no need to 
  1023.            store explicit zero bytes in the object file.  The bss section was 
  1024.            invented to eliminate those explicit zeros from object files. 
  1025.  
  1026.  *absolute section* 
  1027.            Address 0 of this section is always ``relocated'' to runtime address 
  1028.            0. This is useful if you want to refer to an address that ld must 
  1029.            not change when relocating.  In this sense we speak of absolute 
  1030.            addresses being ``unrelocatable'': they do not change during 
  1031.            relocation. 
  1032.  
  1033.  *undefined section* 
  1034.            This ``section'' is a catch-all for address references to objects 
  1035.            not in the preceding sections. 
  1036.  
  1037.  An idealized example of three relocatable sections follows. The example uses 
  1038.  the traditional section names `.text' and `.data'. Memory addresses are on the 
  1039.  horizontal axis. 
  1040.  
  1041.                         +-----+----+--+
  1042.   partial program # 1:  |ttttt|dddd|00|
  1043.                         +-----+----+--+
  1044.  
  1045.                         text   data bss
  1046.                         seg.   seg. seg.
  1047.  
  1048.                         +---+---+---+
  1049.   partial program # 2:  |TTT|DDD|000|
  1050.                         +---+---+---+
  1051.  
  1052.                         +--+---+-----+--+----+---+-----+~~
  1053.   linked program:       |  |TTT|ttttt|  |dddd|DDD|00000|
  1054.                         +--+---+-----+--+----+---+-----+~~
  1055.  
  1056.       addresses:        0 ...
  1057.  
  1058.  
  1059. ΓòÉΓòÉΓòÉ 6.3. as Internal Sections ΓòÉΓòÉΓòÉ
  1060.  
  1061. These sections are meant only for the internal use of as.  They have no meaning 
  1062. at run-time.  You do not really need to know about these sections for most 
  1063. purposes; but they can be mentioned in as warning messages, so it might be 
  1064. helpful to have an idea of their meanings to as.  These sections are used to 
  1065. permit the value of every expression in your assembly language program to be a 
  1066. section-relative address. 
  1067.  
  1068.  ASSEMBLER-INTERNAL-LOGIC-ERROR! 
  1069.            An internal assembler logic error has been found.  This means there 
  1070.            is a bug in the assembler. 
  1071.  
  1072.  expr section 
  1073.            The assembler stores complex expression internally as combinations 
  1074.            of symbols.  When it needs to represent an expression as a symbol, 
  1075.            it puts it in the expr section. 
  1076.  
  1077.  
  1078. ΓòÉΓòÉΓòÉ 6.4. Sub-Sections ΓòÉΓòÉΓòÉ
  1079.  
  1080. Assembled bytes conventionally fall into two sections: text and data. You may 
  1081. have separate groups of data in named sections text or data that you want to 
  1082. end up near to each other in the object file, even though they are not 
  1083. contiguous in the assembler source.  as allows you to use subsections for this 
  1084. purpose.  Within each section, there can be numbered subsections with values 
  1085. from 0 to 8192.  Objects assembled into the same subsection go into the object 
  1086. file together with other objects in the same subsection.  For example, a 
  1087. compiler might want to store constants in the text section, but might not want 
  1088. to have them interspersed with the program being assembled.  In this case, the 
  1089. compiler could issue a `.text 0' before each section of code being output, and 
  1090. a `.text 1' before each group of constants being output. 
  1091.  
  1092. Subsections are optional.  If you do not use subsections, everything goes in 
  1093. subsection number zero. 
  1094.  
  1095. Each subsection is zero-padded up to a multiple of four bytes. (Subsections may 
  1096. be padded a different amount on different flavors of as.) On the AMD 29K 
  1097. family, no particular padding is added to section or subsection sizes; as 
  1098. forces no alignment on this platform. 
  1099.  
  1100. Subsections appear in your object file in numeric order, lowest numbered to 
  1101. highest.  (All this to be compatible with other people's assemblers.) The 
  1102. object file contains no representation of subsections; ld and other programs 
  1103. that manipulate object files see no trace of them. They just see all your text 
  1104. subsections as a text section, and all your data subsections as a data section. 
  1105.  
  1106. To specify which subsection you want subsequent statements assembled into, use 
  1107. a numeric argument to specify it, in a `.text expression' or a `.data 
  1108. expression' statement. When generating COFF output, you can also use an extra 
  1109. subsection argument with arbitrary named sections: `.section name, expression'. 
  1110. Expression should be an absolute expression. (See Expressions.)  If you just 
  1111. say `.text' then `.text 0' is assumed.  Likewise `.data' means `.data 0'. 
  1112. Assembly begins in text 0.  For instance: 
  1113.  
  1114. .text 0     # The default subsection is text 0 anyway.
  1115. .ascii "This lives in the first text subsection. *"
  1116. .text 1
  1117. .ascii "But this lives in the second text subsection."
  1118. .data 0
  1119. .ascii "This lives in the data section,"
  1120. .ascii "in the first data subsection."
  1121. .text 0
  1122. .ascii "This lives in the first text section,"
  1123. .ascii "immediately following the asterisk (*)."
  1124.  
  1125. Each section has a location counter incremented by one for every byte assembled 
  1126. into that section.  Because subsections are merely a convenience restricted to 
  1127. as there is no concept of a subsection location counter.  There is no way to 
  1128. directly manipulate a location counter---but the .align directive changes it, 
  1129. and any label definition captures its current value.  The location counter of 
  1130. the section where statements are being assembled is said to be the active 
  1131. location counter. 
  1132.  
  1133.  
  1134. ΓòÉΓòÉΓòÉ 6.5. bss Section ΓòÉΓòÉΓòÉ
  1135.  
  1136. The bss section is used for local common variable storage. You may allocate 
  1137. address space in the bss section, but you may not dictate data to load into it 
  1138. before your program executes.  When your program starts running, all the 
  1139. contents of the bss section are zeroed bytes. 
  1140.  
  1141. Addresses in the bss section are allocated with special directives; you may not 
  1142. assemble anything directly into the bss section.  Hence there are no bss 
  1143. subsections. See .comm, see .lcomm. 
  1144.  
  1145.  
  1146. ΓòÉΓòÉΓòÉ 7. Symbols ΓòÉΓòÉΓòÉ
  1147.  
  1148. Symbols are a central concept: the programmer uses symbols to name things, the 
  1149. linker uses symbols to link, and the debugger uses symbols to debug. 
  1150.  
  1151. Warning: as does not place symbols in the object file in the same order they 
  1152. were declared.  This may break some debuggers. 
  1153.  
  1154.  Labels                                  Labels 
  1155.  Setting Symbols                         Giving Symbols Other Values 
  1156.  Symbol Names                            Symbol Names 
  1157.  Dot                                     The Special Dot Symbol 
  1158.  Symbol Attributes                       Symbol Attributes 
  1159.  
  1160.  
  1161. ΓòÉΓòÉΓòÉ 7.1. Labels ΓòÉΓòÉΓòÉ
  1162.  
  1163. A label is written as a symbol immediately followed by a colon `:'.  The symbol 
  1164. then represents the current value of the active location counter, and is, for 
  1165. example, a suitable instruction operand.  You are warned if you use the same 
  1166. symbol to represent two different locations: the first definition overrides any 
  1167. other definitions. 
  1168.  
  1169. On the HPPA, the usual form for a label need not be immediately followed by a 
  1170. colon, but instead must start in column zero.  Only one label may be defined on 
  1171. a single line.  To work around this, the HPPA version of as also provides a 
  1172. special directive .label for defining labels more flexibly. 
  1173.  
  1174.  
  1175. ΓòÉΓòÉΓòÉ 7.2. Giving Symbols Other Values ΓòÉΓòÉΓòÉ
  1176.  
  1177. A symbol can be given an arbitrary value by writing a symbol, followed by an 
  1178. equals sign `=', followed by an expression (see Expressions).  This is 
  1179. equivalent to using the .set directive.  See .set. 
  1180.  
  1181.  
  1182. ΓòÉΓòÉΓòÉ 7.3. Symbol Names ΓòÉΓòÉΓòÉ
  1183.  
  1184. Symbol names begin with a letter or with one of `._'.  On most machines, you 
  1185. can also use $ in symbol names; exceptions are noted in Machine Dependencies. 
  1186. That character may be followed by any string of digits, letters, dollar signs 
  1187. (unless otherwise noted in Machine Dependencies), and underscores. For the AMD 
  1188. 29K family, `?' is also allowed in the body of a symbol name, though not at its 
  1189. beginning. 
  1190.  
  1191. Case of letters is significant: foo is a different symbol name than Foo. 
  1192.  
  1193. Each symbol has exactly one name.  Each name in an assembly language program 
  1194. refers to exactly one symbol.  You may use that symbol name any number of times 
  1195. in a program. 
  1196.  
  1197. Local Symbol Names 
  1198.  
  1199. Local symbols help compilers and programmers use names temporarily. There are 
  1200. ten local symbol names, which are re-used throughout the program.  You may 
  1201. refer to them using the names `0' `1' ... `9'.  To define a local symbol, write 
  1202. a label of the form `N:' (where N represents any digit).  To refer to the most 
  1203. recent previous definition of that symbol write `Nb', using the same digit as 
  1204. when you defined the label.  To refer to the next definition of a local label, 
  1205. write `Nf'---where N gives you a choice of 10 forward references.  The `b' 
  1206. stands for ``backwards'' and the `f' stands for ``forwards''. 
  1207.  
  1208. Local symbols are not emitted by the current gnu C compiler. 
  1209.  
  1210. There is no restriction on how you can use these labels, but remember that at 
  1211. any point in the assembly you can refer to at most 10 prior local labels and to 
  1212. at most 10 forward local labels. 
  1213.  
  1214. Local symbol names are only a notation device.  They are immediately 
  1215. transformed into more conventional symbol names before the assembler uses them. 
  1216. The symbol names stored in the symbol table, appearing in error messages and 
  1217. optionally emitted to the object file have these parts: 
  1218.  
  1219.  L 
  1220.            All local labels begin with `L'. Normally both as and ld forget 
  1221.            symbols that start with `L'. These labels are used for symbols you 
  1222.            are never intended to see.  If you use the `-L' option then as 
  1223.            retains these symbols in the object file. If you also instruct ld to 
  1224.            retain these symbols, you may use them in debugging. 
  1225.  
  1226.  digit 
  1227.            If the label is written `0:' then the digit is `0'. If the label is 
  1228.            written `1:' then the digit is `1'. And so on up through `9:'. 
  1229.  
  1230.  ^A 
  1231.            This unusual character is included so you do not accidentally invent 
  1232.            a symbol of the same name.  The character has ASCII value `\001'. 
  1233.  
  1234.  ordinal number 
  1235.            This is a serial number to keep the labels distinct.  The first `0:' 
  1236.            gets the number `1'; The 15th `0:' gets the number `15'; etc.. 
  1237.            Likewise for the other labels `1:' through `9:'. 
  1238.  
  1239.  For instance, the first 1: is named L1^A1, the 44th 3: is named L3^A44. 
  1240.  
  1241.  
  1242. ΓòÉΓòÉΓòÉ 7.4. The Special Dot Symbol ΓòÉΓòÉΓòÉ
  1243.  
  1244. The special symbol `.' refers to the current address that as is assembling 
  1245. into.  Thus, the expression `melvin: .long .' defines melvin to contain its own 
  1246. address. Assigning a value to . is treated the same as a .org directive.  Thus, 
  1247. the expression `.=.+4' is the same as saying `.space 4'. 
  1248.  
  1249.  
  1250. ΓòÉΓòÉΓòÉ 7.5. Symbol Attributes ΓòÉΓòÉΓòÉ
  1251.  
  1252. Every symbol has, as well as its name, the attributes ``Value'' and ``Type''. 
  1253. Depending on output format, symbols can also have auxiliary attributes. 
  1254.  
  1255. If you use a symbol without defining it, as assumes zero for all these 
  1256. attributes, and probably won't warn you.  This makes the symbol an externally 
  1257. defined symbol, which is generally what you would want. 
  1258.  
  1259.  Symbol Value                            Value 
  1260.  Symbol Type                             Type 
  1261.  
  1262.  a.out Symbols                           Symbol Attributes: a.out 
  1263.  
  1264.  a.out Symbols                           Symbol Attributes: a.out 
  1265.  
  1266.  a.out Symbols                           Symbol Attributes: a.out, b.out 
  1267.  
  1268.  COFF Symbols                            Symbol Attributes for COFF 
  1269.  
  1270.  SOM Symbols                             Symbol Attributes for SOM 
  1271.  
  1272.  
  1273. ΓòÉΓòÉΓòÉ 7.5.1. Value ΓòÉΓòÉΓòÉ
  1274.  
  1275. The value of a symbol is (usually) 32 bits.  For a symbol which labels a 
  1276. location in the text, data, bss or absolute sections the value is the number of 
  1277. addresses from the start of that section to the label. Naturally for text, data 
  1278. and bss sections the value of a symbol changes as ld changes section base 
  1279. addresses during linking.  Absolute symbols' values do not change during 
  1280. linking: that is why they are called absolute. 
  1281.  
  1282. The value of an undefined symbol is treated in a special way.  If it is 0 then 
  1283. the symbol is not defined in this assembler source file, and ld tries to 
  1284. determine its value from other files linked into the same program.  You make 
  1285. this kind of symbol simply by mentioning a symbol name without defining it.  A 
  1286. non-zero value represents a .comm common declaration.  The value is how much 
  1287. common storage to reserve, in bytes (addresses).  The symbol refers to the 
  1288. first address of the allocated storage. 
  1289.  
  1290.  
  1291. ΓòÉΓòÉΓòÉ 7.5.2. Type ΓòÉΓòÉΓòÉ
  1292.  
  1293. The type attribute of a symbol contains relocation (section) information, any 
  1294. flag settings indicating that a symbol is external, and (optionally), other 
  1295. information for linkers and debuggers.  The exact format depends on the 
  1296. object-code output format in use. 
  1297.  
  1298.  
  1299. ΓòÉΓòÉΓòÉ 7.5.3. Symbol Attributes: a.out ΓòÉΓòÉΓòÉ
  1300.  
  1301.  Symbol Desc                             Descriptor 
  1302.  Symbol Other                            Other 
  1303.  
  1304.  
  1305. ΓòÉΓòÉΓòÉ 7.5.3.1. Descriptor ΓòÉΓòÉΓòÉ
  1306.  
  1307. This is an arbitrary 16-bit value.  You may establish a symbol's descriptor 
  1308. value by using a .desc statement (see .desc).  A descriptor value means nothing 
  1309. to as. 
  1310.  
  1311.  
  1312. ΓòÉΓòÉΓòÉ 7.5.3.2. Other ΓòÉΓòÉΓòÉ
  1313.  
  1314. This is an arbitrary 8-bit value.  It means nothing to as. 
  1315.  
  1316.  
  1317. ΓòÉΓòÉΓòÉ 7.5.4. Symbol Attributes for COFF ΓòÉΓòÉΓòÉ
  1318.  
  1319. The COFF format supports a multitude of auxiliary symbol attributes; like the 
  1320. primary symbol attributes, they are set between .def and .endef directives. 
  1321.  
  1322.  
  1323. ΓòÉΓòÉΓòÉ 7.5.4.1. Primary Attributes ΓòÉΓòÉΓòÉ
  1324.  
  1325. The symbol name is set with .def; the value and type, respectively, with .val 
  1326. and .type. 
  1327.  
  1328.  
  1329. ΓòÉΓòÉΓòÉ 7.5.4.2. Auxiliary Attributes ΓòÉΓòÉΓòÉ
  1330.  
  1331. The as directives .dim, .line, .scl, .size, and .tag can generate auxiliary 
  1332. symbol table information for COFF. 
  1333.  
  1334.  
  1335. ΓòÉΓòÉΓòÉ 7.5.5. Symbol Attributes for SOM ΓòÉΓòÉΓòÉ
  1336.  
  1337. The SOM format for the HPPA supports a multitude of symbol attributes set with 
  1338. the .EXPORT and .IMPORT directives. 
  1339.  
  1340. The attributes are described in HP9000 Series 800 Assembly Language Reference 
  1341. Manual (HP 92432-90001) under the IMPORT and EXPORT assembler directive 
  1342. documentation. 
  1343.  
  1344.  
  1345. ΓòÉΓòÉΓòÉ 8. Expressions ΓòÉΓòÉΓòÉ
  1346.  
  1347. An expression specifies an address or numeric value. Whitespace may precede 
  1348. and/or follow an expression. 
  1349.  
  1350. The result of an expression must be an absolute number, or else an offset into 
  1351. a particular section.  If an expression is not absolute, and there is not 
  1352. enough information when as sees the expression to know its section, a second 
  1353. pass over the source program might be necessary to interpret the 
  1354. expression---but the second pass is currently not implemented. as aborts with 
  1355. an error message in this situation. 
  1356.  
  1357.  Empty Exprs                             Empty Expressions 
  1358.  Integer Exprs                           Integer Expressions 
  1359.  
  1360.  
  1361. ΓòÉΓòÉΓòÉ 8.1. Empty Expressions ΓòÉΓòÉΓòÉ
  1362.  
  1363. An empty expression has no value: it is just whitespace or null. Wherever an 
  1364. absolute expression is required, you may omit the expression, and as assumes a 
  1365. value of (absolute) 0.  This is compatible with other assemblers. 
  1366.  
  1367.  
  1368. ΓòÉΓòÉΓòÉ 8.2. Integer Expressions ΓòÉΓòÉΓòÉ
  1369.  
  1370. An integer expression is one or more arguments delimited by operators. 
  1371.  
  1372.  Arguments                               Arguments 
  1373.  Operators                               Operators 
  1374.  Prefix Ops                              Prefix Operators 
  1375.  Infix Ops                               Infix Operators 
  1376.  
  1377.  
  1378. ΓòÉΓòÉΓòÉ 8.2.1. Arguments ΓòÉΓòÉΓòÉ
  1379.  
  1380. Arguments are symbols, numbers or subexpressions.  In other contexts arguments 
  1381. are sometimes called ``arithmetic operands''.  In this manual, to avoid 
  1382. confusing them with the ``instruction operands'' of the machine language, we 
  1383. use the term ``argument'' to refer to parts of expressions only, reserving the 
  1384. word ``operand'' to refer only to machine instruction operands. 
  1385.  
  1386. Symbols are evaluated to yield {section NNN} where section is one of text, 
  1387. data, bss, absolute, or undefined.  NNN is a signed, 2's complement 32 bit 
  1388. integer. 
  1389.  
  1390. Numbers are usually integers. 
  1391.  
  1392. A number can be a flonum or bignum.  In this case, you are warned that only the 
  1393. low order 32 bits are used, and as pretends these 32 bits are an integer.  You 
  1394. may write integer-manipulating instructions that act on exotic constants, 
  1395. compatible with other assemblers. 
  1396.  
  1397. Subexpressions are a left parenthesis `(' followed by an integer expression, 
  1398. followed by a right parenthesis `)'; or a prefix operator followed by an 
  1399. argument. 
  1400.  
  1401.  
  1402. ΓòÉΓòÉΓòÉ 8.2.2. Operators ΓòÉΓòÉΓòÉ
  1403.  
  1404. Operators are arithmetic functions, like + or %.  Prefix operators are followed 
  1405. by an argument.  Infix operators appear between their arguments.  Operators may 
  1406. be preceded and/or followed by whitespace. 
  1407.  
  1408.  
  1409. ΓòÉΓòÉΓòÉ 8.2.3. Prefix Operator ΓòÉΓòÉΓòÉ
  1410.  
  1411. as has the following prefix operators.  They each take one argument, which must 
  1412. be absolute. 
  1413.  
  1414.  - 
  1415.            Negation.  Two's complement negation. 
  1416.  
  1417.  ~ 
  1418.            Complementation.  Bitwise not. 
  1419.  
  1420.  
  1421. ΓòÉΓòÉΓòÉ 8.2.4. Infix Operators ΓòÉΓòÉΓòÉ
  1422.  
  1423. Infix operators take two arguments, one on either side.  Operators have 
  1424. precedence, but operations with equal precedence are performed left to right. 
  1425. Apart from + or -, both arguments must be absolute, and the result is absolute. 
  1426.  
  1427.    1. Highest Precedence 
  1428.  
  1429.       * 
  1430.                      Multiplication. 
  1431.  
  1432.       / 
  1433.                      Division.  Truncation is the same as the C operator `/' 
  1434.  
  1435.       % 
  1436.                      Remainder. 
  1437.  
  1438.       < 
  1439.       << 
  1440.                      Shift Left.  Same as the C operator `<<'. 
  1441.  
  1442.       > 
  1443.       >> 
  1444.                      Shift Right.  Same as the C operator `>>'. 
  1445.  
  1446.    2. Intermediate precedence 
  1447.  
  1448.       | 
  1449.                      Bitwise Inclusive Or. 
  1450.  
  1451.       & 
  1452.                      Bitwise And. 
  1453.  
  1454.       ^ 
  1455.                      Bitwise Exclusive Or. 
  1456.  
  1457.       ! 
  1458.                      Bitwise Or Not. 
  1459.  
  1460.    3. Lowest Precedence 
  1461.  
  1462.       + 
  1463.                      Addition.  If either argument is absolute, the result has 
  1464.                      the section of the other argument.  You may not add 
  1465.                      together arguments from different sections. 
  1466.  
  1467.       - 
  1468.                      Subtraction.  If the right argument is absolute, the 
  1469.                      result has the section of the left argument. If both 
  1470.                      arguments are in the same section, the result is absolute. 
  1471.                      You may not subtract arguments from different sections. 
  1472.  
  1473.  In short, it's only meaningful to add or subtract the offsets in an address; 
  1474.  you can only have a defined section in one of the two arguments. 
  1475.  
  1476.  
  1477. ΓòÉΓòÉΓòÉ 9. Assembler Directives ΓòÉΓòÉΓòÉ
  1478.  
  1479. All assembler directives have names that begin with a period (`.'). The rest of 
  1480. the name is letters, usually in lower case. 
  1481.  
  1482. This chapter discusses directives that are available regardless of the target 
  1483. machine configuration for the gnu assembler. Some machine configurations 
  1484. provide additional directives. See Machine Dependencies. 
  1485.  
  1486.  Abort                                   .abort 
  1487.  
  1488.  ABORT                                   .ABORT 
  1489.  
  1490.  Align                                   .align abs-expr , abs-expr 
  1491.  App-File                                .app-file string 
  1492.  Ascii                                   .ascii "string" 
  1493.  Asciz                                   .asciz "string" 
  1494.  Byte                                    .byte expressions 
  1495.  Comm                                    .comm symbol , length 
  1496.  Data                                    .data subsection 
  1497.  
  1498.  Def                                     .def name 
  1499.  
  1500.  Desc                                    .desc symbol, abs-expression 
  1501.  
  1502.  Dim                                     .dim 
  1503.  
  1504.  Double                                  .double flonums 
  1505.  Eject                                   .eject 
  1506.  Else                                    .else 
  1507.  
  1508.  Endef                                   .endef 
  1509.  
  1510.  Endif                                   .endif 
  1511.  Equ                                     .equ symbol, expression 
  1512.  Extern                                  .extern 
  1513.  
  1514.  File                                    .file string 
  1515.  
  1516.  Fill                                    .fill repeat , size , value 
  1517.  Float                                   .float flonums 
  1518.  Global                                  .global symbol, .globl symbol 
  1519.  hword                                   .hword expressions 
  1520.  Ident                                   .ident 
  1521.  If                                      .if absolute expression 
  1522.  Include                                 .include "file" 
  1523.  Int                                     .int expressions 
  1524.  Lcomm                                   .lcomm symbol , length 
  1525.  Lflags                                  .lflags 
  1526.  
  1527.  Line                                    .line line-number 
  1528.  
  1529.  Ln                                      .ln line-number 
  1530.  List                                    .list 
  1531.  Long                                    .long expressions 
  1532.  
  1533.  Lsym                                    .lsym symbol, expression 
  1534.  
  1535.  Nolist                                  .nolist 
  1536.  Octa                                    .octa bignums 
  1537.  Org                                     .org new-lc , fill 
  1538.  Psize                                   .psize lines, columns 
  1539.  Quad                                    .quad bignums 
  1540.  Sbttl                                   .sbttl "subheading" 
  1541.  
  1542.  Scl                                     .scl class 
  1543.  
  1544.  Section                                 .section name, subsection 
  1545.  
  1546.  Set                                     .set symbol, expression 
  1547.  Short                                   .short expressions 
  1548.  Single                                  .single flonums 
  1549.  
  1550.  Size                                    .size 
  1551.  
  1552.  Space                                   .space size , fill 
  1553.  
  1554.  Stab                                    .stabd, .stabn, .stabs 
  1555.  
  1556.  String                                  .string "str" 
  1557.  
  1558.  Tag                                     .tag structname 
  1559.  
  1560.  Text                                    .text subsection 
  1561.  Title                                   .title "heading" 
  1562.  
  1563.  Type                                    .type int 
  1564.  Val                                     .val addr 
  1565.  
  1566.  Word                                    .word expressions 
  1567.  Deprecated                              Deprecated Directives 
  1568.  
  1569.  
  1570. ΓòÉΓòÉΓòÉ 9.1. .abort ΓòÉΓòÉΓòÉ
  1571.  
  1572. This directive stops the assembly immediately.  It is for compatibility with 
  1573. other assemblers.  The original idea was that the assembly language source 
  1574. would be piped into the assembler.  If the sender of the source quit, it could 
  1575. use this directive tells as to quit also.  One day .abort will not be 
  1576. supported. 
  1577.  
  1578.  
  1579. ΓòÉΓòÉΓòÉ 9.2. .ABORT ΓòÉΓòÉΓòÉ
  1580.  
  1581. When producing COFF output, as accepts this directive as a synonym for 
  1582. `.abort'. 
  1583.  
  1584. When producing b.out output, as accepts this directive, but ignores it. 
  1585.  
  1586.  
  1587. ΓòÉΓòÉΓòÉ 9.3. .align abs-expr , abs-expr ΓòÉΓòÉΓòÉ
  1588.  
  1589. Pad the location counter (in the current subsection) to a particular storage 
  1590. boundary.  The first expression (which must be absolute) is the number of 
  1591. low-order zero bits the location counter must have after advancement.  For 
  1592. example `.align 3' advances the location counter until it a multiple of 8.  If 
  1593. the location counter is already a multiple of 8, no change is needed. 
  1594.  
  1595. For the HPPA, the first expression (which must be absolute) is the alignment 
  1596. request in bytes.  For example `.align 8' advances the location counter until 
  1597. it is a multiple of 8.  If the location counter is already a multiple of 8, no 
  1598. change is needed. 
  1599.  
  1600. The second expression (also absolute) gives the value to be stored in the 
  1601. padding bytes.  It (and the comma) may be omitted.  If it is omitted, the 
  1602. padding bytes are zero. 
  1603.  
  1604.  
  1605. ΓòÉΓòÉΓòÉ 9.4. .app-file string ΓòÉΓòÉΓòÉ
  1606.  
  1607. .app-file (which may also be spelled `.file') tells as that we are about to 
  1608. start a new logical file.  string is the new file name.  In general, the 
  1609. filename is recognized whether or not it is surrounded by quotes `"'; but if 
  1610. you wish to specify an empty file name is permitted, you must give the 
  1611. quotes--"".  This statement may go away in future: it is only recognized to be 
  1612. compatible with old as programs. 
  1613.  
  1614.  
  1615. ΓòÉΓòÉΓòÉ 9.5. .ascii "string" ΓòÉΓòÉΓòÉ
  1616.  
  1617. .ascii expects zero or more string literals (see Strings) separated by commas. 
  1618. It assembles each string (with no automatic trailing zero byte) into 
  1619. consecutive addresses. 
  1620.  
  1621.  
  1622. ΓòÉΓòÉΓòÉ 9.6. .asciz "string" ΓòÉΓòÉΓòÉ
  1623.  
  1624. .asciz is just like .ascii, but each string is followed by a zero byte.  The 
  1625. ``z'' in `.asciz' stands for ``zero''. 
  1626.  
  1627.  
  1628. ΓòÉΓòÉΓòÉ 9.7. .byte expressions ΓòÉΓòÉΓòÉ
  1629.  
  1630. .byte expects zero or more expressions, separated by commas. Each expression is 
  1631. assembled into the next byte. 
  1632.  
  1633.  
  1634. ΓòÉΓòÉΓòÉ 9.8. .comm symbol , length ΓòÉΓòÉΓòÉ
  1635.  
  1636. .comm declares a named common area in the bss section.  Normally ld reserves 
  1637. memory addresses for it during linking, so no partial program defines the 
  1638. location of the symbol.  Use .comm to tell ld that it must be at least length 
  1639. bytes long.  ld allocates space for each .comm symbol that is at least as long 
  1640. as the longest .comm request in any of the partial programs linked.  length is 
  1641. an absolute expression. 
  1642.  
  1643. The syntax for .comm differs slightly on the HPPA.  The syntax is `symbol 
  1644. .comm, length'; symbol is optional. 
  1645.  
  1646.  
  1647. ΓòÉΓòÉΓòÉ 9.9. .data subsection ΓòÉΓòÉΓòÉ
  1648.  
  1649. .data tells as to assemble the following statements onto the end of the data 
  1650. subsection numbered subsection (which is an absolute expression).  If 
  1651. subsection is omitted, it defaults to zero. 
  1652.  
  1653.  
  1654. ΓòÉΓòÉΓòÉ 9.10. .def name ΓòÉΓòÉΓòÉ
  1655.  
  1656. Begin defining debugging information for a symbol name; the definition extends 
  1657. until the .endef directive is encountered. 
  1658.  
  1659. This directive is only observed when as is configured for COFF format output; 
  1660. when producing b.out, `.def' is recognized, but ignored. 
  1661.  
  1662.  
  1663. ΓòÉΓòÉΓòÉ 9.11. .desc symbol, abs-expression ΓòÉΓòÉΓòÉ
  1664.  
  1665. This directive sets the descriptor of the symbol (see Symbol Attributes) to the 
  1666. low 16 bits of an absolute expression. 
  1667.  
  1668. The `.desc' directive is not available when as is configured for COFF output; 
  1669. it is only for a.out or b.out object format.  For the sake of compatibility, as 
  1670. accepts it, but produces no output, when configured for COFF. 
  1671.  
  1672.  
  1673. ΓòÉΓòÉΓòÉ 9.12. .dim ΓòÉΓòÉΓòÉ
  1674.  
  1675. This directive is generated by compilers to include auxiliary debugging 
  1676. information in the symbol table.  It is only permitted inside .def/.endef 
  1677. pairs. 
  1678.  
  1679. `.dim' is only meaningful when generating COFF format output; when as is 
  1680. generating b.out, it accepts this directive but ignores it. 
  1681.  
  1682.  
  1683. ΓòÉΓòÉΓòÉ 9.13. .double flonums ΓòÉΓòÉΓòÉ
  1684.  
  1685. .double expects zero or more flonums, separated by commas.  It assembles 
  1686. floating point numbers. The exact kind of floating point numbers emitted 
  1687. depends on how as is configured.  See Machine Dependencies. 
  1688.  
  1689.  
  1690. ΓòÉΓòÉΓòÉ 9.14. .eject ΓòÉΓòÉΓòÉ
  1691.  
  1692. Force a page break at this point, when generating assembly listings. 
  1693.  
  1694.  
  1695. ΓòÉΓòÉΓòÉ 9.15. .else ΓòÉΓòÉΓòÉ
  1696.  
  1697. .else is part of the as support for conditional assembly; see .if.  It marks 
  1698. the beginning of a section of code to be assembled if the condition for the 
  1699. preceding .if was false. 
  1700.  
  1701.  
  1702. ΓòÉΓòÉΓòÉ 9.16. .endef ΓòÉΓòÉΓòÉ
  1703.  
  1704. This directive flags the end of a symbol definition begun with .def. 
  1705.  
  1706. `.endef' is only meaningful when generating COFF format output; if as is 
  1707. configured to generate b.out, it accepts this directive but ignores it. 
  1708.  
  1709.  
  1710. ΓòÉΓòÉΓòÉ 9.17. .endif ΓòÉΓòÉΓòÉ
  1711.  
  1712. .endif is part of the as support for conditional assembly; it marks the end of 
  1713. a block of code that is only assembled conditionally.  See .if. 
  1714.  
  1715.  
  1716. ΓòÉΓòÉΓòÉ 9.18. .equ symbol, expression ΓòÉΓòÉΓòÉ
  1717.  
  1718. This directive sets the value of symbol to expression. It is synonymous with 
  1719. `.set'; see .set. 
  1720.  
  1721. The syntax for equ on the HPPA is `symbol .equ expression'. 
  1722.  
  1723.  
  1724. ΓòÉΓòÉΓòÉ 9.19. .extern ΓòÉΓòÉΓòÉ
  1725.  
  1726. .extern is accepted in the source program---for compatibility with other 
  1727. assemblers---but it is ignored.  as treats all undefined symbols as external. 
  1728.  
  1729.  
  1730. ΓòÉΓòÉΓòÉ 9.20. .file string ΓòÉΓòÉΓòÉ
  1731.  
  1732. .file (which may also be spelled `.app-file') tells as that we are about to 
  1733. start a new logical file. string is the new file name.  In general, the 
  1734. filename is recognized whether or not it is surrounded by quotes `"'; but if 
  1735. you wish to specify an empty file name, you must give the quotes--"".  This 
  1736. statement may go away in future: it is only recognized to be compatible with 
  1737. old as programs. In some configurations of as, .file has already been removed 
  1738. to avoid conflicts with other assemblers.  See Machine Dependencies. 
  1739.  
  1740.  
  1741. ΓòÉΓòÉΓòÉ 9.21. .fill repeat , size , value ΓòÉΓòÉΓòÉ
  1742.  
  1743. result, size and value are absolute expressions. This emits repeat copies of 
  1744. size bytes.  Repeat may be zero or more.  Size may be zero or more, but if it 
  1745. is more than 8, then it is deemed to have the value 8, compatible with other 
  1746. people's assemblers.  The contents of each repeat bytes is taken from an 8-byte 
  1747. number.  The highest order 4 bytes are zero.  The lowest order 4 bytes are 
  1748. value rendered in the byte-order of an integer on the computer as is assembling 
  1749. for. Each size bytes in a repetition is taken from the lowest order size bytes 
  1750. of this number.  Again, this bizarre behavior is compatible with other people's 
  1751. assemblers. 
  1752.  
  1753. size and value are optional. If the second comma and value are absent, value is 
  1754. assumed zero.  If the first comma and following tokens are absent, size is 
  1755. assumed to be 1. 
  1756.  
  1757.  
  1758. ΓòÉΓòÉΓòÉ 9.22. .float flonums ΓòÉΓòÉΓòÉ
  1759.  
  1760. This directive assembles zero or more flonums, separated by commas.  It has the 
  1761. same effect as .single. The exact kind of floating point numbers emitted 
  1762. depends on how as is configured. See Machine Dependencies. 
  1763.  
  1764.  
  1765. ΓòÉΓòÉΓòÉ 9.23. .global symbol, .globl symbol ΓòÉΓòÉΓòÉ
  1766.  
  1767. .global makes the symbol visible to ld.  If you define symbol in your partial 
  1768. program, its value is made available to other partial programs that are linked 
  1769. with it.  Otherwise, symbol takes its attributes from a symbol of the same name 
  1770. from another file linked into the same program. 
  1771.  
  1772. Both spellings (`.globl' and `.global') are accepted, for compatibility with 
  1773. other assemblers. 
  1774.  
  1775. On the HPPA, .global is not always enough to make it accessible to other 
  1776. partial programs.  You may need the HPPA-only .EXPORT directive as well. See 
  1777. HPPA Assembler Directives. 
  1778.  
  1779.  
  1780. ΓòÉΓòÉΓòÉ 9.24. .hword expressions ΓòÉΓòÉΓòÉ
  1781.  
  1782. This expects zero or more expressions, and emits a 16 bit number for each. 
  1783.  
  1784. This directive is a synonym for `.short'; depending on the target architecture, 
  1785. it may also be a synonym for `.word'. 
  1786.  
  1787.  
  1788. ΓòÉΓòÉΓòÉ 9.25. .ident ΓòÉΓòÉΓòÉ
  1789.  
  1790. This directive is used by some assemblers to place tags in object files. as 
  1791. simply accepts the directive for source-file compatibility with such 
  1792. assemblers, but does not actually emit anything for it. 
  1793.  
  1794.  
  1795. ΓòÉΓòÉΓòÉ 9.26. .if absolute expression ΓòÉΓòÉΓòÉ
  1796.  
  1797. .if marks the beginning of a section of code which is only considered part of 
  1798. the source program being assembled if the argument (which must be an absolute 
  1799. expression) is non-zero.  The end of the conditional section of code must be 
  1800. marked by .endif (see .endif); optionally, you may include code for the 
  1801. alternative condition, flagged by .else (see .else. 
  1802.  
  1803. The following variants of .if are also supported: 
  1804.  
  1805.  .ifdef symbol 
  1806.            Assembles the following section of code if the specified symbol has 
  1807.            been defined. 
  1808.  
  1809.  .ifndef symbol 
  1810.  ifnotdef symbol 
  1811.            Assembles the following section of code if the specified symbol has 
  1812.            not been defined.  Both spelling variants are equivalent. 
  1813.  
  1814.  
  1815. ΓòÉΓòÉΓòÉ 9.27. .include "file" ΓòÉΓòÉΓòÉ
  1816.  
  1817. This directive provides a way to include supporting files at specified points 
  1818. in your source program.  The code from file is assembled as if it followed the 
  1819. point of the .include; when the end of the included file is reached, assembly 
  1820. of the original file continues.  You can control the search paths used with the 
  1821. `-I' command-line option (see Command-Line Options).  Quotation marks are 
  1822. required around file. 
  1823.  
  1824.  
  1825. ΓòÉΓòÉΓòÉ 9.28. .int expressions ΓòÉΓòÉΓòÉ
  1826.  
  1827. Expect zero or more expressions, of any section, separated by commas. For each 
  1828. expression, emit a number that, at run time, is the value of that expression. 
  1829. The byte order and bit size of the number depends on what kind of target the 
  1830. assembly is for. 
  1831.  
  1832.  
  1833. ΓòÉΓòÉΓòÉ 9.29. .lcomm symbol , length ΓòÉΓòÉΓòÉ
  1834.  
  1835. Reserve length (an absolute expression) bytes for a local common denoted by 
  1836. symbol.  The section and value of symbol are those of the new local common. 
  1837. The addresses are allocated in the bss section, so that at run-time the bytes 
  1838. start off zeroed.  Symbol is not declared global (see .global), so is normally 
  1839. not visible to ld. 
  1840.  
  1841. The syntax for .lcomm differs slightly on the HPPA.  The syntax is `symbol 
  1842. .lcomm, length'; symbol is optional. 
  1843.  
  1844.  
  1845. ΓòÉΓòÉΓòÉ 9.30. .lflags ΓòÉΓòÉΓòÉ
  1846.  
  1847. as accepts this directive, for compatibility with other assemblers, but ignores 
  1848. it. 
  1849.  
  1850.  
  1851. ΓòÉΓòÉΓòÉ 9.31. .line line-number ΓòÉΓòÉΓòÉ
  1852.  
  1853. Change the logical line number.  line-number must be an absolute expression. 
  1854. The next line has that logical line number.  Therefore any other statements on 
  1855. the current line (after a statement separator character) are reported as on 
  1856. logical line number line-number - 1.  One day as will no longer support this 
  1857. directive: it is recognized only for compatibility with existing assembler 
  1858. programs. 
  1859.  
  1860. Warning: In the AMD29K configuration of as, this command is not available; use 
  1861. the synonym .ln in that context. 
  1862.  
  1863. Even though this is a directive associated with the a.out or b.out object-code 
  1864. formats, as still recognizes it when producing COFF output, and treats `.line' 
  1865. as though it were the COFF `.ln' if it is found outside a .def/.endef pair. 
  1866.  
  1867. Inside a .def, `.line' is, instead, one of the directives used by compilers to 
  1868. generate auxiliary symbol information for debugging. 
  1869.  
  1870.  
  1871. ΓòÉΓòÉΓòÉ 9.32. .ln line-number ΓòÉΓòÉΓòÉ
  1872.  
  1873. `.ln' is a synonym for `.line'. 
  1874.  
  1875.  
  1876. ΓòÉΓòÉΓòÉ 9.33. .list ΓòÉΓòÉΓòÉ
  1877.  
  1878. Control (in conjunction with the .nolist directive) whether or not assembly 
  1879. listings are generated.  These two directives maintain an internal counter 
  1880. (which is zero initially).  .list increments the counter, and .nolist 
  1881. decrements it.  Assembly listings are generated whenever the counter is greater 
  1882. than zero. 
  1883.  
  1884. By default, listings are disabled.  When you enable them (with the `-a' command 
  1885. line option; see Command-Line Options), the initial value of the listing 
  1886. counter is one. 
  1887.  
  1888.  
  1889. ΓòÉΓòÉΓòÉ 9.34. .long expressions ΓòÉΓòÉΓòÉ
  1890.  
  1891. .long is the same as `.int', see .int. 
  1892.  
  1893.  
  1894. ΓòÉΓòÉΓòÉ 9.35. .nolist ΓòÉΓòÉΓòÉ
  1895.  
  1896. Control (in conjunction with the .list directive) whether or not assembly 
  1897. listings are generated.  These two directives maintain an internal counter 
  1898. (which is zero initially).  .list increments the counter, and .nolist 
  1899. decrements it.  Assembly listings are generated whenever the counter is greater 
  1900. than zero. 
  1901.  
  1902.  
  1903. ΓòÉΓòÉΓòÉ 9.36. .octa bignums ΓòÉΓòÉΓòÉ
  1904.  
  1905. This directive expects zero or more bignums, separated by commas.  For each 
  1906. bignum, it emits a 16-byte integer. 
  1907.  
  1908. The term ``octa'' comes from contexts in which a ``word'' is two bytes; hence 
  1909. octa-word for 16 bytes. 
  1910.  
  1911.  
  1912. ΓòÉΓòÉΓòÉ 9.37. .org new-lc , fill ΓòÉΓòÉΓòÉ
  1913.  
  1914. Advance the location counter of the current section to new-lc.  new-lc is 
  1915. either an absolute expression or an expression with the same section as the 
  1916. current subsection.  That is, you can't use .org to cross sections: if new-lc 
  1917. has the wrong section, the .org directive is ignored.  To be compatible with 
  1918. former assemblers, if the section of new-lc is absolute, as issues a warning, 
  1919. then pretends the section of new-lc is the same as the current subsection. 
  1920.  
  1921. .org may only increase the location counter, or leave it unchanged; you cannot 
  1922. use .org to move the location counter backwards. 
  1923.  
  1924. Because as tries to assemble programs in one pass, new-lc may not be undefined. 
  1925. If you really detest this restriction we eagerly await a chance to share your 
  1926. improved assembler. 
  1927.  
  1928. Beware that the origin is relative to the start of the section, not to the 
  1929. start of the subsection.  This is compatible with other people's assemblers. 
  1930.  
  1931. When the location counter (of the current subsection) is advanced, the 
  1932. intervening bytes are filled with fill which should be an absolute expression. 
  1933. If the comma and fill are omitted, fill defaults to zero. 
  1934.  
  1935.  
  1936. ΓòÉΓòÉΓòÉ 9.38. .psize lines , columns ΓòÉΓòÉΓòÉ
  1937.  
  1938. Use this directive to declare the number of lines---and, optionally, the number 
  1939. of columns---to use for each page, when generating listings. 
  1940.  
  1941. If you do not use .psize, listings use a default line-count of 60.  You may 
  1942. omit the comma and columns specification; the default width is 200 columns. 
  1943.  
  1944. as generates formfeeds whenever the specified number of lines is exceeded (or 
  1945. whenever you explicitly request one, using .eject). 
  1946.  
  1947. If you specify lines as 0, no formfeeds are generated save those explicitly 
  1948. specified with .eject. 
  1949.  
  1950.  
  1951. ΓòÉΓòÉΓòÉ 9.39. .quad bignums ΓòÉΓòÉΓòÉ
  1952.  
  1953. .quad expects zero or more bignums, separated by commas.  For each bignum, it 
  1954. emits an 8-byte integer.  If the bignum won't fit in 8 bytes, it prints a 
  1955. warning message; and just takes the lowest order 8 bytes of the bignum. 
  1956.  
  1957. The term ``quad'' comes from contexts in which a ``word'' is two bytes; hence 
  1958. quad-word for 8 bytes. 
  1959.  
  1960.  
  1961. ΓòÉΓòÉΓòÉ 9.40. .sbttl "subheading" ΓòÉΓòÉΓòÉ
  1962.  
  1963. Use subheading as the title (third line, immediately after the title line) when 
  1964. generating assembly listings. 
  1965.  
  1966. This directive affects subsequent pages, as well as the current page if it 
  1967. appears within ten lines of the top of a page. 
  1968.  
  1969.  
  1970. ΓòÉΓòÉΓòÉ 9.41. .scl class ΓòÉΓòÉΓòÉ
  1971.  
  1972. Set the storage-class value for a symbol.  This directive may only be used 
  1973. inside a .def/.endef pair.  Storage class may flag whether a symbol is static 
  1974. or external, or it may record further symbolic debugging information. 
  1975.  
  1976. The `.scl' directive is primarily associated with COFF output; when configured 
  1977. to generate b.out output format, as accepts this directive but ignores it. 
  1978.  
  1979.  
  1980. ΓòÉΓòÉΓòÉ 9.42. .section name, subsection ΓòÉΓòÉΓòÉ
  1981.  
  1982. Assemble the following code into end of subsection numbered subsection in the 
  1983. COFF named section name.  If you omit subsection, as uses subsection number 
  1984. zero. `.section .text' is equivalent to the .text directive; `.section .data' 
  1985. is equivalent to the .data directive. 
  1986.  
  1987.  
  1988. ΓòÉΓòÉΓòÉ 9.43. .set symbol, expression ΓòÉΓòÉΓòÉ
  1989.  
  1990. Set the value of symbol to expression.  This changes symbol's value and type to 
  1991. conform to expression.  If symbol was flagged as external, it remains flagged. 
  1992. (See Symbol Attributes.) 
  1993.  
  1994. You may .set a symbol many times in the same assembly. 
  1995.  
  1996. If you .set a global symbol, the value stored in the object file is the last 
  1997. value stored into it. 
  1998.  
  1999. The syntax for set on the HPPA is `symbol .set expression'. 
  2000.  
  2001.  
  2002. ΓòÉΓòÉΓòÉ 9.44. .short expressions ΓòÉΓòÉΓòÉ
  2003.  
  2004. .short is normally the same as `.word'. See .word. 
  2005.  
  2006. In some configurations, however, .short and .word generate numbers of different 
  2007. lengths; see Machine Dependencies. 
  2008.  
  2009.  
  2010. ΓòÉΓòÉΓòÉ 9.45. .single flonums ΓòÉΓòÉΓòÉ
  2011.  
  2012. This directive assembles zero or more flonums, separated by commas.  It has the 
  2013. same effect as .float. The exact kind of floating point numbers emitted depends 
  2014. on how as is configured.  See Machine Dependencies. 
  2015.  
  2016.  
  2017. ΓòÉΓòÉΓòÉ 9.46. .size ΓòÉΓòÉΓòÉ
  2018.  
  2019. This directive is generated by compilers to include auxiliary debugging 
  2020. information in the symbol table.  It is only permitted inside .def/.endef 
  2021. pairs. 
  2022.  
  2023. `.size' is only meaningful when generating COFF format output; when as is 
  2024. generating b.out, it accepts this directive but ignores it. 
  2025.  
  2026.  
  2027. ΓòÉΓòÉΓòÉ 9.47. .space size , fill ΓòÉΓòÉΓòÉ
  2028.  
  2029. This directive emits size bytes, each of value fill.  Both size and fill are 
  2030. absolute expressions.  If the comma and fill are omitted, fill is assumed to be 
  2031. zero. 
  2032.  
  2033. Warning: .space has a completely different meaning for HPPA targets; use .block 
  2034. as a substitute.  See HP9000 Series 800 Assembly Language Reference Manual (HP 
  2035. 92432-90001) for the meaning of the .space directive.  See HPPA Assembler 
  2036. Directives, for a summary. On the AMD 29K, this directive is ignored; it is 
  2037. accepted for 
  2038.  
  2039. compatibility with other AMD 29K assemblers. 
  2040.  
  2041. Warning: In most versions of the gnu assembler, the directive .space has the 
  2042. effect of .block  See Machine Dependencies. 
  2043.  
  2044.  
  2045. ΓòÉΓòÉΓòÉ 9.48. .stabd, .stabn, .stabs ΓòÉΓòÉΓòÉ
  2046.  
  2047. There are three directives that begin `.stab'. All emit symbols (see Symbols), 
  2048. for use by symbolic debuggers. The symbols are not entered in the as hash 
  2049. table: they cannot be referenced elsewhere in the source file. Up to five 
  2050. fields are required: 
  2051.  
  2052.  string 
  2053.            This is the symbol's name.  It may contain any character except 
  2054.            `\000', so is more general than ordinary symbol names.  Some 
  2055.            debuggers used to code arbitrarily complex structures into symbol 
  2056.            names using this field. 
  2057.  
  2058.  type 
  2059.            An absolute expression.  The symbol's type is set to the low 8 bits 
  2060.            of this expression.  Any bit pattern is permitted, but ld and 
  2061.            debuggers choke on silly bit patterns. 
  2062.  
  2063.  other 
  2064.            An absolute expression.  The symbol's ``other'' attribute is set to 
  2065.            the low 8 bits of this expression. 
  2066.  
  2067.  desc 
  2068.            An absolute expression.  The symbol's descriptor is set to the low 
  2069.            16 bits of this expression. 
  2070.  
  2071.  value 
  2072.            An absolute expression which becomes the symbol's value. 
  2073.  
  2074.  If a warning is detected while reading a .stabd, .stabn, or .stabs statement, 
  2075.  the symbol has probably already been created; you get a half-formed symbol in 
  2076.  your object file.  This is compatible with earlier assemblers! 
  2077.  
  2078.  .stabd type , other , desc 
  2079.            The ``name'' of the symbol generated is not even an empty string. It 
  2080.            is a null pointer, for compatibility.  Older assemblers used a null 
  2081.            pointer so they didn't waste space in object files with empty 
  2082.            strings. 
  2083.  
  2084.            The symbol's value is set to the location counter, relocatably. 
  2085.            When your program is linked, the value of this symbol is the address 
  2086.            of the location counter when the .stabd was assembled. 
  2087.  
  2088.  .stabn type , other , desc , value 
  2089.            The name of the symbol is set to the empty string "". 
  2090.  
  2091.  .stabs string ,  type , other , desc , value 
  2092.            All five fields are specified. 
  2093.  
  2094.  
  2095. ΓòÉΓòÉΓòÉ 9.49. .string "str" ΓòÉΓòÉΓòÉ
  2096.  
  2097. Copy the characters in str to the object file.  You may specify more than one 
  2098. string to copy, separated by commas.  Unless otherwise specified for a 
  2099. particular machine, the assembler marks the end of each string with a 0 byte. 
  2100. You can use any of the escape sequences described in Strings. 
  2101.  
  2102.  
  2103. ΓòÉΓòÉΓòÉ 9.50. .tag structname ΓòÉΓòÉΓòÉ
  2104.  
  2105. This directive is generated by compilers to include auxiliary debugging 
  2106. information in the symbol table.  It is only permitted inside .def/.endef 
  2107. pairs.  Tags are used to link structure definitions in the symbol table with 
  2108. instances of those structures. 
  2109.  
  2110. `.tag' is only used when generating COFF format output; when as is generating 
  2111. b.out, it accepts this directive but ignores it. 
  2112.  
  2113.  
  2114. ΓòÉΓòÉΓòÉ 9.51. .text subsection ΓòÉΓòÉΓòÉ
  2115.  
  2116. Tells as to assemble the following statements onto the end of the text 
  2117. subsection numbered subsection, which is an absolute expression.  If subsection 
  2118. is omitted, subsection number zero is used. 
  2119.  
  2120.  
  2121. ΓòÉΓòÉΓòÉ 9.52. .title "heading" ΓòÉΓòÉΓòÉ
  2122.  
  2123. Use heading as the title (second line, immediately after the source file name 
  2124. and pagenumber) when generating assembly listings. 
  2125.  
  2126. This directive affects subsequent pages, as well as the current page if it 
  2127. appears within ten lines of the top of a page. 
  2128.  
  2129.  
  2130. ΓòÉΓòÉΓòÉ 9.53. .type int ΓòÉΓòÉΓòÉ
  2131.  
  2132. This directive, permitted only within .def/.endef pairs, records the integer 
  2133. int as the type attribute of a symbol table entry. 
  2134.  
  2135. `.type' is associated only with COFF format output; when as is configured for 
  2136. b.out output, it accepts this directive but ignores it. 
  2137.  
  2138.  
  2139. ΓòÉΓòÉΓòÉ 9.54. .val addr ΓòÉΓòÉΓòÉ
  2140.  
  2141. This directive, permitted only within .def/.endef pairs, records the address 
  2142. addr as the value attribute of a symbol table entry. 
  2143.  
  2144. `.val' is used only for COFF output; when as is configured for b.out, it 
  2145. accepts this directive but ignores it. 
  2146.  
  2147.  
  2148. ΓòÉΓòÉΓòÉ 9.55. .word expressions ΓòÉΓòÉΓòÉ
  2149.  
  2150. This directive expects zero or more expressions, of any section, separated by 
  2151. commas. 
  2152.  
  2153. The size of the number emitted, and its byte order, depend on what target 
  2154. computer the assembly is for. 
  2155.  
  2156. Warning: Special Treatment to support Compilers 
  2157.  
  2158. Machines with a 32-bit address space, but that do less than 32-bit addressing, 
  2159. require the following special treatment.  If the machine of interest to you 
  2160. does 32-bit addressing (or doesn't require it; see Machine Dependencies), you 
  2161. can ignore this issue. 
  2162.  
  2163. In order to assemble compiler output into something that works, as occasionlly 
  2164. does strange things to `.word' directives. Directives of the form `.word 
  2165. sym1-sym2' are often emitted by compilers as part of jump tables.  Therefore, 
  2166. when as assembles a directive of the form `.word sym1-sym2', and the difference 
  2167. between sym1 and sym2 does not fit in 16 bits, as creates a secondary jump 
  2168. table, immediately before the next label. This secondary jump table is preceded 
  2169. by a short-jump to the first byte after the secondary table.  This short-jump 
  2170. prevents the flow of control from accidentally falling into the new table. 
  2171. Inside the table is a long-jump to sym2.  The original `.word' contains sym1 
  2172. minus the address of the long-jump to sym2. 
  2173.  
  2174. If there were several occurrences of `.word sym1-sym2' before the secondary 
  2175. jump table, all of them are adjusted.  If there was a `.word sym3-sym4', that 
  2176. also did not fit in sixteen bits, a long-jump to sym4 is included in the 
  2177. secondary jump table, and the .word directives are adjusted to contain sym3 
  2178. minus the address of the long-jump to sym4; and so on, for as many entries in 
  2179. the original jump table as necessary. 
  2180.  
  2181.  
  2182. ΓòÉΓòÉΓòÉ 9.56. Deprecated Directives ΓòÉΓòÉΓòÉ
  2183.  
  2184. One day these directives won't work. They are included for compatibility with 
  2185. older assemblers. 
  2186.  
  2187.  .abort 
  2188.  
  2189.  .app-file 
  2190.  
  2191.  .line 
  2192.  
  2193.  
  2194. ΓòÉΓòÉΓòÉ 10. Machine Dependent Features ΓòÉΓòÉΓòÉ
  2195.  
  2196. The machine instruction sets are (almost by definition) different on each 
  2197. machine where as runs.  Floating point representations vary as well, and as 
  2198. often supports a few additional directives or command-line options for 
  2199. compatibility with other assemblers on a particular platform.  Finally, some 
  2200. versions of as support special pseudo-instructions for branch optimization. 
  2201.  
  2202. This chapter discusses most of these differences, though it does not include 
  2203. details on any machine's instruction set.  For details on that subject, see the 
  2204. hardware manufacturer's manual. 
  2205.  
  2206.  Vax-Dependent                           VAX Dependent Features 
  2207.  
  2208.  AMD29K-Dependent                        AMD 29K Dependent Features 
  2209.  
  2210.  H8/300-Dependent                        Hitachi H8/300 Dependent Features 
  2211.  
  2212.  H8/500-Dependent                        Hitachi H8/500 Dependent Features 
  2213.  
  2214.  HPPA-Dependent                          HPPA Dependent Features 
  2215.  
  2216.  SH-Dependent                            Hitachi SH Dependent Features 
  2217.  
  2218.  i960-Dependent                          Intel 80960 Dependent Features 
  2219.  
  2220.  M68K-Dependent                          M680x0 Dependent Features 
  2221.  
  2222.  Sparc-Dependent                         SPARC Dependent Features 
  2223.  
  2224.  Z8000-Dependent                         Z8000 Dependent Features 
  2225.  
  2226.  MIPS-Dependent                          MIPS Dependent Features 
  2227.  
  2228.  i386-Dependent                          80386 Dependent Features 
  2229.  
  2230.  
  2231. ΓòÉΓòÉΓòÉ 11. VAX Dependent Features ΓòÉΓòÉΓòÉ
  2232.  
  2233.  Vax-Opts                                VAX Command-Line Options 
  2234.  
  2235.  
  2236.  VAX-float                               VAX Floating Point 
  2237.  VAX-directives                          Vax Machine Directives 
  2238.  VAX-opcodes                             VAX Opcodes 
  2239.  VAX-branch                              VAX Branch Improvement 
  2240.  VAX-operands                            VAX Operands 
  2241.  VAX-no                                  Not Supported on VAX 
  2242.  
  2243.  
  2244. ΓòÉΓòÉΓòÉ 11.1. VAX Command-Line Options ΓòÉΓòÉΓòÉ
  2245.  
  2246. The Vax version of as accepts any of the following options, gives a warning 
  2247. message that the option was ignored and proceeds. These options are for 
  2248. compatibility with scripts designed for other people's assemblers. 
  2249.  
  2250.  -D (Debug) 
  2251.  -S (Symbol Table) 
  2252.  -T (Token Trace) 
  2253.            These are obsolete options used to debug old assemblers. 
  2254.  
  2255.  -d (Displacement size for JUMPs) 
  2256.            This option expects a number following the `-d'.  Like options that 
  2257.            expect filenames, the number may immediately follow the `-d' (old 
  2258.            standard) or constitute the whole of the command line argument that 
  2259.            follows `-d' (gnu standard). 
  2260.  
  2261.  -V (Virtualize Interpass Temporary File) 
  2262.            Some other assemblers use a temporary file.  This option commanded 
  2263.            them to keep the information in active memory rather than in a disk 
  2264.            file.  as always does this, so this option is redundant. 
  2265.  
  2266.  -J (JUMPify Longer Branches) 
  2267.            Many 32-bit computers permit a variety of branch instructions to do 
  2268.            the same job.  Some of these instructions are short (and fast) but 
  2269.            have a limited range; others are long (and slow) but can branch 
  2270.            anywhere in virtual memory.  Often there are 3 flavors of branch: 
  2271.            short, medium and long.  Some other assemblers would emit short and 
  2272.            medium branches, unless told by this option to emit short and long 
  2273.            branches. 
  2274.  
  2275.  -t (Temporary File Directory) 
  2276.            Some other assemblers may use a temporary file, and this option 
  2277.            takes a filename being the directory to site the temporary file. 
  2278.            Since as does not use a temporary disk file, this option makes no 
  2279.            difference.  `-t' needs exactly one filename. 
  2280.  
  2281.  The Vax version of the assembler accepts two options when compiled for VMS. 
  2282.  They are `-h', and `-+'.  The `-h' option prevents as from modifying the 
  2283.  symbol-table entries for symbols that contain lowercase characters (I think). 
  2284.  The `-+' option causes as to print warning messages if the FILENAME part of 
  2285.  the object file, or any symbol name is larger than 31 characters.  The `-+' 
  2286.  option also inserts some code following the `_main' symbol so that the object 
  2287.  file is compatible with Vax-11 "C". 
  2288.  
  2289.  
  2290. ΓòÉΓòÉΓòÉ 11.2. VAX Floating Point ΓòÉΓòÉΓòÉ
  2291.  
  2292. Conversion of flonums to floating point is correct, and compatible with 
  2293. previous assemblers.  Rounding is towards zero if the remainder is exactly half 
  2294. the least significant bit. 
  2295.  
  2296. D, F, G and H floating point formats are understood. 
  2297.  
  2298. Immediate floating literals (e.g. `S`$6.9') are rendered correctly.  Again, 
  2299. rounding is towards zero in the boundary case. 
  2300.  
  2301. The .float directive produces f format numbers. The .double directive produces 
  2302. d format numbers. 
  2303.  
  2304.  
  2305. ΓòÉΓòÉΓòÉ 11.3. Vax Machine Directives ΓòÉΓòÉΓòÉ
  2306.  
  2307. The Vax version of the assembler supports four directives for generating Vax 
  2308. floating point constants.  They are described in the table below. 
  2309.  
  2310.  .dfloat 
  2311.            This expects zero or more flonums, separated by commas, and 
  2312.            assembles Vax d format 64-bit floating point constants. 
  2313.  
  2314.  .ffloat 
  2315.            This expects zero or more flonums, separated by commas, and 
  2316.            assembles Vax f format 32-bit floating point constants. 
  2317.  
  2318.  .gfloat 
  2319.            This expects zero or more flonums, separated by commas, and 
  2320.            assembles Vax g format 64-bit floating point constants. 
  2321.  
  2322.  .hfloat 
  2323.            This expects zero or more flonums, separated by commas, and 
  2324.            assembles Vax h format 128-bit floating point constants. 
  2325.  
  2326.  
  2327. ΓòÉΓòÉΓòÉ 11.4. VAX Opcodes ΓòÉΓòÉΓòÉ
  2328.  
  2329. All DEC mnemonics are supported.  Beware that case... instructions have exactly 
  2330. 3 operands.  The dispatch table that follows the case... instruction should be 
  2331. made with .word statements.  This is compatible with all unix assemblers we 
  2332. know of. 
  2333.  
  2334.  
  2335. ΓòÉΓòÉΓòÉ 11.5. VAX Branch Improvement ΓòÉΓòÉΓòÉ
  2336.  
  2337. Certain pseudo opcodes are permitted.  They are for branch instructions.  They 
  2338. expand to the shortest branch instruction that reaches the target.  Generally 
  2339. these mnemonics are made by substituting `j' for `b' at the start of a DEC 
  2340. mnemonic. This feature is included both for compatibility and to help 
  2341. compilers.  If you do not need this feature, avoid these opcodes.  Here are the 
  2342. mnemonics, and the code they can expand into. 
  2343.  
  2344.  jbsb 
  2345.            `Jsb' is already an instruction mnemonic, so we chose `jbsb'. 
  2346.  
  2347.            (byte displacement) 
  2348.                           bsbb ... 
  2349.  
  2350.            (word displacement) 
  2351.                           bsbw ... 
  2352.  
  2353.            (long displacement) 
  2354.                           jsb ... 
  2355.  
  2356.  jbr 
  2357.  jr 
  2358.            Unconditional branch. 
  2359.  
  2360.            (byte displacement) 
  2361.                           brb ... 
  2362.  
  2363.            (word displacement) 
  2364.                           brw ... 
  2365.  
  2366.            (long displacement) 
  2367.                           jmp ... 
  2368.  
  2369.  jCOND 
  2370.            COND may be any one of the conditional branches neq, nequ, eql, 
  2371.            eqlu, gtr, geq, lss, gtru, lequ, vc, vs, gequ, cc, lssu, cs. COND 
  2372.            may also be one of the bit tests bs, bc, bss, bcs, bsc, bcc, bssi, 
  2373.            bcci, lbs, lbc. NOTCOND is the opposite condition to COND. 
  2374.  
  2375.            (byte displacement) 
  2376.                           bCOND ... 
  2377.  
  2378.            (word displacement) 
  2379.                           bNOTCOND foo ; brw ... ; foo: 
  2380.  
  2381.            (long displacement) 
  2382.                           bNOTCOND foo ; jmp ... ; foo: 
  2383.  
  2384.  jacbX 
  2385.            X may be one of b d f g h l w. 
  2386.  
  2387.            (word displacement) 
  2388.                           OPCODE ... 
  2389.  
  2390.            (long displacement) 
  2391.  
  2392.                       OPCODE ..., foo ;
  2393.                       brb bar ;
  2394.                       foo: jmp ... ;
  2395.                       bar:
  2396.  
  2397.  jaobYYY 
  2398.            YYY may be one of lss leq. 
  2399.  
  2400.  jsobZZZ 
  2401.            ZZZ may be one of geq gtr. 
  2402.  
  2403.            (byte displacement) 
  2404.                           OPCODE ... 
  2405.  
  2406.            (word displacement) 
  2407.  
  2408.                       OPCODE ..., foo ;
  2409.                       brb bar ;
  2410.                       foo: brw destination ;
  2411.                       bar:
  2412.  
  2413.            (long displacement) 
  2414.  
  2415.                       OPCODE ..., foo ;
  2416.                       brb bar ;
  2417.                       foo: jmp destination ;
  2418.                       bar:
  2419.  
  2420.  aobleq 
  2421.  aoblss 
  2422.  sobgeq 
  2423.  sobgtr 
  2424.  
  2425.            (byte displacement) 
  2426.                           OPCODE ... 
  2427.  
  2428.            (word displacement) 
  2429.  
  2430.                       OPCODE ..., foo ;
  2431.                       brb bar ;
  2432.                       foo: brw destination ;
  2433.                       bar:
  2434.  
  2435.            (long displacement) 
  2436.  
  2437.                       OPCODE ..., foo ;
  2438.                       brb bar ;
  2439.                       foo: jmp destination ;
  2440.                       bar:
  2441.  
  2442.  
  2443. ΓòÉΓòÉΓòÉ 11.6. VAX Operands ΓòÉΓòÉΓòÉ
  2444.  
  2445. The immediate character is `$' for Unix compatibility, not `#' as DEC writes 
  2446. it. 
  2447.  
  2448. The indirect character is `*' for Unix compatibility, not `@' as DEC writes it. 
  2449.  
  2450. The displacement sizing character is ``' (an accent grave) for Unix 
  2451. compatibility, not `^' as DEC writes it.  The letter preceding ``' may have 
  2452. either case.  `G' is not understood, but all other letters (b i l s w) are 
  2453. understood. 
  2454.  
  2455. Register names understood are r0 r1 r2 ... r15 ap fp sp pc.  Upper and lower 
  2456. case letters are equivalent. 
  2457.  
  2458. For instance 
  2459.  
  2460. tstb *w`$4(r5)
  2461.  
  2462. Any expression is permitted in an operand.  Operands are comma separated. 
  2463.  
  2464.  
  2465. ΓòÉΓòÉΓòÉ 11.7. Not Supported on VAX ΓòÉΓòÉΓòÉ
  2466.  
  2467. Vax bit fields can not be assembled with as.  Someone can add the required code 
  2468. if they really need it. 
  2469.  
  2470.  
  2471. ΓòÉΓòÉΓòÉ 12. AMD 29K Dependent Features ΓòÉΓòÉΓòÉ
  2472.  
  2473.  AMD29K Options                          Options 
  2474.  AMD29K Syntax                           Syntax 
  2475.  AMD29K Floating Point                   Floating Point 
  2476.  AMD29K Directives                       AMD 29K Machine Directives 
  2477.  AMD29K Opcodes                          Opcodes 
  2478.  
  2479.  
  2480. ΓòÉΓòÉΓòÉ 12.1. Options ΓòÉΓòÉΓòÉ
  2481.  
  2482. as has no additional command-line options for the AMD 29K family. 
  2483.  
  2484.  
  2485. ΓòÉΓòÉΓòÉ 12.2. Syntax ΓòÉΓòÉΓòÉ
  2486.  
  2487.  AMD29K-Chars                            Special Characters 
  2488.  AMD29K-Regs                             Register Names 
  2489.  
  2490.  
  2491. ΓòÉΓòÉΓòÉ 12.2.1. Special Characters ΓòÉΓòÉΓòÉ
  2492.  
  2493. `;' is the line comment character. 
  2494.  
  2495. `@' can be used instead of a newline to separate statements. 
  2496.  
  2497. The character `?' is permitted in identifiers (but may not begin an 
  2498. identifier). 
  2499.  
  2500.  
  2501. ΓòÉΓòÉΓòÉ 12.2.2. Register Names ΓòÉΓòÉΓòÉ
  2502.  
  2503. General-purpose registers are represented by predefined symbols of the form 
  2504. `GRnnn' (for global registers) or `LRnnn' (for local registers), where nnn 
  2505. represents a number between 0 and 127, written with no leading zeros.  The 
  2506. leading letters may be in either upper or lower case; for example, `gr13' and 
  2507. `LR7' are both valid register names. 
  2508.  
  2509. You may also refer to general-purpose registers by specifying the register 
  2510. number as the result of an expression (prefixed with `%%' to flag the 
  2511. expression as a register number): 
  2512.  
  2513. %%expression
  2514.  
  2515. ---where expression must be an absolute expression evaluating to a number 
  2516. between 0 and 255.  The range [0, 127] refers to global registers, and the 
  2517. range [128, 255] to local registers. 
  2518.  
  2519. In addition, as understands the following protected special-purpose register 
  2520. names for the AMD 29K family: 
  2521.  
  2522.   vab    chd    pc0
  2523.   ops    chc    pc1
  2524.   cps    rbp    pc2
  2525.   cfg    tmc    mmu
  2526.   cha    tmr    lru
  2527.  
  2528. These unprotected special-purpose register names are also recognized: 
  2529.  
  2530.   ipc    alu    fpe
  2531.   ipa    bp     inte
  2532.   ipb    fc     fps
  2533.   q      cr     exop
  2534.  
  2535.  
  2536. ΓòÉΓòÉΓòÉ 12.3. Floating Point ΓòÉΓòÉΓòÉ
  2537.  
  2538. The AMD 29K family uses ieee floating-point numbers. 
  2539.  
  2540.  
  2541. ΓòÉΓòÉΓòÉ 12.4. AMD 29K Machine Directives ΓòÉΓòÉΓòÉ
  2542.  
  2543.  .block size , fill 
  2544.            This directive emits size bytes, each of value fill.  Both size and 
  2545.            fill are absolute expressions.  If the comma and fill are omitted, 
  2546.            fill is assumed to be zero. 
  2547.  
  2548.            In other versions of the gnu assembler, this directive is called 
  2549.            `.space'. 
  2550.  
  2551.  .cputype 
  2552.            This directive is ignored; it is accepted for compatibility with 
  2553.            other AMD 29K assemblers. 
  2554.  
  2555.  .file 
  2556.            This directive is ignored; it is accepted for compatibility with 
  2557.            other AMD 29K assemblers. 
  2558.  
  2559.            Warning: in other versions of the gnu assembler, .file is used for 
  2560.            the directive called .app-file in the AMD 29K support. 
  2561.  
  2562.  .line 
  2563.            This directive is ignored; it is accepted for compatibility with 
  2564.            other AMD 29K assemblers. 
  2565.  
  2566.  .sect 
  2567.            This directive is ignored; it is accepted for compatibility with 
  2568.            other AMD 29K assemblers. 
  2569.  
  2570.  .use section name 
  2571.            Establishes the section and subsection for the following code; 
  2572.            section name may be one of .text, .data, .data1, or .lit.  With one 
  2573.            of the first three section name options, `.use' is equivalent to the 
  2574.            machine directive section name; the remaining case, `.use .lit', is 
  2575.            the same as `.data 200'. 
  2576.  
  2577.  
  2578. ΓòÉΓòÉΓòÉ 12.5. Opcodes ΓòÉΓòÉΓòÉ
  2579.  
  2580. as implements all the standard AMD 29K opcodes.  No additional 
  2581. pseudo-instructions are needed on this family. 
  2582.  
  2583. For information on the 29K machine instruction set, see Am29000 User's Manual, 
  2584. Advanced Micro Devices, Inc. 
  2585.  
  2586.  H8/300-Dependent                        Hitachi H8/300 Dependent Features 
  2587.  
  2588.  
  2589.  H8/500-Dependent                        Hitachi H8/500 Dependent Features 
  2590.  SH-Dependent                            Hitachi SH Dependent Features 
  2591.  
  2592.  
  2593. ΓòÉΓòÉΓòÉ 13. H8/300 Dependent Features ΓòÉΓòÉΓòÉ
  2594.  
  2595.  H8/300 Options                          Options 
  2596.  H8/300 Syntax                           Syntax 
  2597.  H8/300 Floating Point                   Floating Point 
  2598.  H8/300 Directives                       H8/300 Machine Directives 
  2599.  H8/300 Opcodes                          Opcodes 
  2600.  
  2601.  
  2602. ΓòÉΓòÉΓòÉ 13.1. Options ΓòÉΓòÉΓòÉ
  2603.  
  2604. as has no additional command-line options for the Hitachi H8/300 family. 
  2605.  
  2606.  
  2607. ΓòÉΓòÉΓòÉ 13.2. Syntax ΓòÉΓòÉΓòÉ
  2608.  
  2609.  H8/300-Chars                            Special Characters 
  2610.  H8/300-Regs                             Register Names 
  2611.  H8/300-Addressing                       Addressing Modes 
  2612.  
  2613.  
  2614. ΓòÉΓòÉΓòÉ 13.2.1. Special Characters ΓòÉΓòÉΓòÉ
  2615.  
  2616. `;' is the line comment character. 
  2617.  
  2618. `$' can be used instead of a newline to separate statements. Therefore you may 
  2619. not use `$' in symbol names on the H8/300. 
  2620.  
  2621.  
  2622. ΓòÉΓòÉΓòÉ 13.2.2. Register Names ΓòÉΓòÉΓòÉ
  2623.  
  2624. You can use predefined symbols of the form `rnh' and `rnl' to refer to the 
  2625. H8/300 registers as sixteen 8-bit general-purpose registers.  n is a digit from 
  2626. `0' to `7'); for instance, both `r0h' and `r7l' are valid register names. 
  2627.  
  2628. You can also use the eight predefined symbols `rn' to refer to the H8/300 
  2629. registers as 16-bit registers (you must use this form for addressing). 
  2630.  
  2631. On the H8/300H, you can also use the eight predefined symbols `ern' (`er0' ... 
  2632. `er7') to refer to the 32-bit general purpose registers. 
  2633.  
  2634. The two control registers are called pc (program counter; a 16-bit register, 
  2635. except on the H8/300H where it is 24 bits) and ccr (condition code register; an 
  2636. 8-bit register).  r7 is used as the stack pointer, and can also be called sp. 
  2637.  
  2638.  
  2639. ΓòÉΓòÉΓòÉ 13.2.3. Addressing Modes ΓòÉΓòÉΓòÉ
  2640.  
  2641. as understands the following addressing modes for the H8/300: 
  2642.  
  2643.  rn 
  2644.            Register direct 
  2645.  
  2646.  @rn 
  2647.            Register indirect 
  2648.  
  2649.  @(d, rn) 
  2650.  @(d:16, rn) 
  2651.  @(d:24, rn) 
  2652.            Register indirect: 16-bit or 24-bit displacement d from register n. 
  2653.            (24-bit displacements are only meaningful on the H8/300H.) 
  2654.  
  2655.  @rn+ 
  2656.            Register indirect with post-increment 
  2657.  
  2658.  @-rn 
  2659.            Register indirect with pre-decrement 
  2660.  
  2661.  @aa 
  2662.  @aa:8 
  2663.  @aa:16 
  2664.  @aa:24 
  2665.            Absolute address aa.  (The address size `:24' only makes sense on 
  2666.            the H8/300H.) 
  2667.  
  2668.  #xx 
  2669.  #xx:8 
  2670.  #xx:16 
  2671.  #xx:32 
  2672.            Immediate data xx.  You may specify the `:8', `:16', or `:32' for 
  2673.            clarity, if you wish; but as neither requires this nor uses it---the 
  2674.            data size required is taken from context. 
  2675.  
  2676.  @@aa 
  2677.  @@aa:8 
  2678.            Memory indirect.  You may specify the `:8' for clarity, if you wish; 
  2679.            but as neither requires this nor uses it. 
  2680.  
  2681.  
  2682. ΓòÉΓòÉΓòÉ 13.3. Floating Point ΓòÉΓòÉΓòÉ
  2683.  
  2684. The H8/300 family has no hardware floating point, but the .float directive 
  2685. generates ieee floating-point numbers for compatibility with other development 
  2686. tools. 
  2687.  
  2688.  
  2689. ΓòÉΓòÉΓòÉ 13.4. H8/300 Machine Directives ΓòÉΓòÉΓòÉ
  2690.  
  2691. as has only one machine-dependent directive for the H8/300: 
  2692.  
  2693.  .h300h 
  2694.            Recognize and emit additional instructions for the H8/300H variant, 
  2695.            and also make .int emit 32-bit numbers rather than the usual 
  2696.            (16-bit) for the H8/300 family. 
  2697.  
  2698.  On the H8/300 family (including the H8/300H) `.word' directives generate 
  2699.  16-bit numbers. 
  2700.  
  2701.  
  2702. ΓòÉΓòÉΓòÉ 13.5. Opcodes ΓòÉΓòÉΓòÉ
  2703.  
  2704. For detailed information on the H8/300 machine instruction set, see H8/300 
  2705. Series Programming Manual (Hitachi ADE--602--025).  For information specific to 
  2706. the H8/300H, see H8/300H Series Programming Manual (Hitachi). 
  2707.  
  2708. as implements all the standard H8/300 opcodes.  No additional 
  2709. pseudo-instructions are needed on this family. 
  2710.  
  2711. The following table summarizes the H8/300 opcodes, and their arguments. Entries 
  2712. marked `*' are opcodes used only on the H8/300H. 
  2713.  
  2714.          Legend:
  2715.             Rs   source register
  2716.             Rd   destination register
  2717.             abs  absolute address
  2718.             imm  immediate data
  2719.          disp:N  N-bit displacement from a register
  2720.         pcrel:N  N-bit displacement relative to program counter
  2721.  
  2722.    add.b #imm,rd              *  andc #imm,ccr
  2723.    add.b rs,rd                   band #imm,rd
  2724.    add.w rs,rd                   band #imm,@rd
  2725. *  add.w #imm,rd                 band #imm,@abs:8
  2726. *  add.l rs,rd                   bra  pcrel:8
  2727. *  add.l #imm,rd              *  bra  pcrel:16
  2728.    adds #imm,rd                  bt   pcrel:8
  2729.    addx #imm,rd               *  bt   pcrel:16
  2730.    addx rs,rd                    brn  pcrel:8
  2731.    and.b #imm,rd              *  brn  pcrel:16
  2732.    and.b rs,rd                   bf   pcrel:8
  2733. *  and.w rs,rd                *  bf   pcrel:16
  2734. *  and.w #imm,rd                 bhi  pcrel:8
  2735. *  and.l #imm,rd              *  bhi  pcrel:16
  2736. *  and.l rs,rd                   bls  pcrel:8
  2737.  
  2738. *  bls  pcrel:16                 bld  #imm,rd
  2739.    bcc  pcrel:8                  bld  #imm,@rd
  2740. *  bcc  pcrel:16                 bld  #imm,@abs:8
  2741.    bhs  pcrel:8                  bnot #imm,rd
  2742. *  bhs  pcrel:16                 bnot #imm,@rd
  2743.    bcs  pcrel:8                  bnot #imm,@abs:8
  2744. *  bcs  pcrel:16                 bnot rs,rd
  2745.    blo  pcrel:8                  bnot rs,@rd
  2746. *  blo  pcrel:16                 bnot rs,@abs:8
  2747.    bne  pcrel:8                  bor  #imm,rd
  2748. *  bne  pcrel:16                 bor  #imm,@rd
  2749.    beq  pcrel:8                  bor  #imm,@abs:8
  2750. *  beq  pcrel:16                 bset #imm,rd
  2751.    bvc  pcrel:8                  bset #imm,@rd
  2752. *  bvc  pcrel:16                 bset #imm,@abs:8
  2753.    bvs  pcrel:8                  bset rs,rd
  2754. *  bvs  pcrel:16                 bset rs,@rd
  2755.    bpl  pcrel:8                  bset rs,@abs:8
  2756. *  bpl  pcrel:16                 bsr  pcrel:8
  2757.    bmi  pcrel:8                  bsr  pcrel:16
  2758. *  bmi  pcrel:16                 bst  #imm,rd
  2759.    bge  pcrel:8                  bst  #imm,@rd
  2760. *  bge  pcrel:16                 bst  #imm,@abs:8
  2761.    blt  pcrel:8                  btst #imm,rd
  2762. *  blt  pcrel:16                 btst #imm,@rd
  2763.    bgt  pcrel:8                  btst #imm,@abs:8
  2764. *  bgt  pcrel:16                 btst rs,rd
  2765.    ble  pcrel:8                  btst rs,@rd
  2766. *  ble  pcrel:16                 btst rs,@abs:8
  2767.    bclr #imm,rd                  bxor #imm,rd
  2768.    bclr #imm,@rd                 bxor #imm,@rd
  2769.    bclr #imm,@abs:8              bxor #imm,@abs:8
  2770.    bclr rs,rd                    cmp.b #imm,rd
  2771.    bclr rs,@rd                   cmp.b rs,rd
  2772.    bclr rs,@abs:8                cmp.w rs,rd
  2773.    biand #imm,rd                 cmp.w rs,rd
  2774.    biand #imm,@rd             *  cmp.w #imm,rd
  2775.    biand #imm,@abs:8          *  cmp.l #imm,rd
  2776.    bild #imm,rd               *  cmp.l rs,rd
  2777.    bild #imm,@rd                 daa  rs
  2778.    bild #imm,@abs:8              das  rs
  2779.    bior #imm,rd                  dec.b rs
  2780.    bior #imm,@rd              *  dec.w #imm,rd
  2781.    bior #imm,@abs:8           *  dec.l #imm,rd
  2782.    bist #imm,rd                  divxu.b rs,rd
  2783.    bist #imm,@rd              *  divxu.w rs,rd
  2784.    bist #imm,@abs:8           *  divxs.b rs,rd
  2785.    bixor #imm,rd              *  divxs.w rs,rd
  2786.    bixor #imm,@rd                eepmov
  2787.    bixor #imm,@abs:8          *  eepmovw
  2788.  
  2789. *  exts.w rd                     mov.w rs,@abs:16
  2790. *  exts.l rd                  *  mov.l #imm,rd
  2791. *  extu.w rd                  *  mov.l rs,rd
  2792. *  extu.l rd                  *  mov.l @rs,rd
  2793.    inc  rs                    *  mov.l @(disp:16,rs),rd
  2794. *  inc.w #imm,rd              *  mov.l @(disp:24,rs),rd
  2795. *  inc.l #imm,rd              *  mov.l @rs+,rd
  2796.    jmp  @rs                   *  mov.l @abs:16,rd
  2797.    jmp  abs                   *  mov.l @abs:24,rd
  2798.    jmp  @@abs:8               *  mov.l rs,@rd
  2799.    jsr  @rs                   *  mov.l rs,@(disp:16,rd)
  2800.    jsr  abs                   *  mov.l rs,@(disp:24,rd)
  2801.    jsr  @@abs:8               *  mov.l rs,@-rd
  2802.    ldc  #imm,ccr              *  mov.l rs,@abs:16
  2803.    ldc  rs,ccr                *  mov.l rs,@abs:24
  2804. *  ldc  @abs:16,ccr              movfpe @abs:16,rd
  2805. *  ldc  @abs:24,ccr              movtpe rs,@abs:16
  2806. *  ldc  @(disp:16,rs),ccr        mulxu.b rs,rd
  2807. *  ldc  @(disp:24,rs),ccr     *  mulxu.w rs,rd
  2808. *  ldc  @rs+,ccr              *  mulxs.b rs,rd
  2809. *  ldc  @rs,ccr               *  mulxs.w rs,rd
  2810. *  mov.b @(disp:24,rs),rd        neg.b rs
  2811. *  mov.b rs,@(disp:24,rd)     *  neg.w rs
  2812.    mov.b @abs:16,rd           *  neg.l rs
  2813.    mov.b rs,rd                   nop
  2814.    mov.b @abs:8,rd               not.b rs
  2815.    mov.b rs,@abs:8            *  not.w rs
  2816.    mov.b rs,rd                *  not.l rs
  2817.    mov.b #imm,rd                 or.b #imm,rd
  2818.    mov.b @rs,rd                  or.b rs,rd
  2819.    mov.b @(disp:16,rs),rd     *  or.w #imm,rd
  2820.    mov.b @rs+,rd              *  or.w rs,rd
  2821.    mov.b @abs:8,rd            *  or.l #imm,rd
  2822.    mov.b rs,@rd               *  or.l rs,rd
  2823.    mov.b rs,@(disp:16,rd)        orc  #imm,ccr
  2824.    mov.b rs,@-rd                 pop.w rs
  2825.    mov.b rs,@abs:8            *  pop.l rs
  2826.    mov.w rs,@rd                  push.w rs
  2827. *  mov.w @(disp:24,rs),rd     *  push.l rs
  2828. *  mov.w rs,@(disp:24,rd)        rotl.b rs
  2829. *  mov.w @abs:24,rd           *  rotl.w rs
  2830. *  mov.w rs,@abs:24           *  rotl.l rs
  2831.    mov.w rs,rd                   rotr.b rs
  2832.    mov.w #imm,rd              *  rotr.w rs
  2833.    mov.w @rs,rd               *  rotr.l rs
  2834.    mov.w @(disp:16,rs),rd        rotxl.b rs
  2835.    mov.w @rs+,rd              *  rotxl.w rs
  2836.    mov.w @abs:16,rd           *  rotxl.l rs
  2837.    mov.w rs,@(disp:16,rd)        rotxr.b rs
  2838.    mov.w rs,@-rd              *  rotxr.w rs
  2839.  
  2840. *  rotxr.l rs                 *  stc  ccr,@(disp:24,rd)
  2841.    bpt                        *  stc  ccr,@-rd
  2842.    rte                        *  stc  ccr,@abs:16
  2843.    rts                        *  stc  ccr,@abs:24
  2844.    shal.b rs                     sub.b rs,rd
  2845. *  shal.w rs                     sub.w rs,rd
  2846. *  shal.l rs                  *  sub.w #imm,rd
  2847.    shar.b rs                  *  sub.l rs,rd
  2848. *  shar.w rs                  *  sub.l #imm,rd
  2849. *  shar.l rs                     subs #imm,rd
  2850.    shll.b rs                     subx #imm,rd
  2851. *  shll.w rs                     subx rs,rd
  2852. *  shll.l rs                  *  trapa #imm
  2853.    shlr.b rs                     xor  #imm,rd
  2854. *  shlr.w rs                     xor  rs,rd
  2855. *  shlr.l rs                  *  xor.w #imm,rd
  2856.    sleep                      *  xor.w rs,rd
  2857.    stc  ccr,rd                *  xor.l #imm,rd
  2858. *  stc  ccr,@rs               *  xor.l rs,rd
  2859. *  stc  ccr,@(disp:16,rd)        xorc #imm,ccr
  2860.  
  2861. Four H8/300 instructions (add, cmp, mov, sub) are defined with variants using 
  2862. the suffixes `.b', `.w', and `.l' to specify the size of a memory operand. as 
  2863. supports these suffixes, but does not require them; since one of the operands 
  2864. is always a register, as can deduce the correct size. 
  2865.  
  2866. For example, since r0 refers to a 16-bit register, 
  2867.  
  2868. mov    r0,@foo
  2869. is equivalent to
  2870. mov.w  r0,@foo
  2871.  
  2872. If you use the size suffixes, as issues a warning when the suffix and the 
  2873. register size do not match. 
  2874.  
  2875.  
  2876. ΓòÉΓòÉΓòÉ 14. H8/500 Dependent Features ΓòÉΓòÉΓòÉ
  2877.  
  2878.  H8/500 Options                          Options 
  2879.  H8/500 Syntax                           Syntax 
  2880.  H8/500 Floating Point                   Floating Point 
  2881.  H8/500 Directives                       H8/500 Machine Directives 
  2882.  H8/500 Opcodes                          Opcodes 
  2883.  
  2884.  
  2885. ΓòÉΓòÉΓòÉ 14.1. Options ΓòÉΓòÉΓòÉ
  2886.  
  2887. as has no additional command-line options for the Hitachi H8/500 family. 
  2888.  
  2889.  
  2890. ΓòÉΓòÉΓòÉ 14.2. Syntax ΓòÉΓòÉΓòÉ
  2891.  
  2892.  H8/500-Chars                            Special Characters 
  2893.  H8/500-Regs                             Register Names 
  2894.  H8/500-Addressing                       Addressing Modes 
  2895.  
  2896.  
  2897. ΓòÉΓòÉΓòÉ 14.2.1. Special Characters ΓòÉΓòÉΓòÉ
  2898.  
  2899. `!' is the line comment character. 
  2900.  
  2901. `;' can be used instead of a newline to separate statements. 
  2902.  
  2903. Since `$' has no special meaning, you may use it in symbol names. 
  2904.  
  2905.  
  2906. ΓòÉΓòÉΓòÉ 14.2.2. Register Names ΓòÉΓòÉΓòÉ
  2907.  
  2908. You can use the predefined symbols `r0', `r1', `r2', `r3', `r4', `r5', `r6', 
  2909. and `r7' to refer to the H8/500 registers. 
  2910.  
  2911. The H8/500 also has these control registers: 
  2912.  
  2913.  cp 
  2914.            code pointer 
  2915.  
  2916.  dp 
  2917.            data pointer 
  2918.  
  2919.  bp 
  2920.            base pointer 
  2921.  
  2922.  tp 
  2923.            stack top pointer 
  2924.  
  2925.  ep 
  2926.            extra pointer 
  2927.  
  2928.  sr 
  2929.            status register 
  2930.  
  2931.  ccr 
  2932.            condition code register 
  2933.  
  2934.  All registers are 16 bits long.  To represent 32 bit numbers, use two adjacent 
  2935.  registers; for distant memory addresses, use one of the segment pointers (cp 
  2936.  for the program counter; dp for r0--r3; ep for r4 and r5; and tp for r6 and 
  2937.  r7. 
  2938.  
  2939.  
  2940. ΓòÉΓòÉΓòÉ 14.2.3. Addressing Modes ΓòÉΓòÉΓòÉ
  2941.  
  2942. as understands the following addressing modes for the H8/500: 
  2943.  
  2944.  Rn 
  2945.            Register direct 
  2946.  
  2947.  @Rn 
  2948.            Register indirect 
  2949.  
  2950.  @(d:8, Rn) 
  2951.            Register indirect with 8 bit signed displacement 
  2952.  
  2953.  @(d:16, Rn) 
  2954.            Register indirect with 16 bit signed displacement 
  2955.  
  2956.  @-Rn 
  2957.            Register indirect with pre-decrement 
  2958.  
  2959.  @Rn+ 
  2960.            Register indirect with post-increment 
  2961.  
  2962.  @aa:8 
  2963.            8 bit absolute address 
  2964.  
  2965.  @aa:16 
  2966.            16 bit absolute address 
  2967.  
  2968.  #xx:8 
  2969.            8 bit immediate 
  2970.  
  2971.  #xx:16 
  2972.            16 bit immediate 
  2973.  
  2974.  
  2975. ΓòÉΓòÉΓòÉ 14.3. Floating Point ΓòÉΓòÉΓòÉ
  2976.  
  2977. The H8/500 family uses ieee floating-point numbers. 
  2978.  
  2979.  
  2980. ΓòÉΓòÉΓòÉ 14.4. H8/500 Machine Directives ΓòÉΓòÉΓòÉ
  2981.  
  2982. as has no machine-dependent directives for the H8/500. However, on this 
  2983. platform the `.int' and `.word' directives generate 16-bit numbers. 
  2984.  
  2985.  
  2986. ΓòÉΓòÉΓòÉ 14.5. Opcodes ΓòÉΓòÉΓòÉ
  2987.  
  2988. For detailed information on the H8/500 machine instruction set, see H8/500 
  2989. Series Programming Manual (Hitachi M21T001). 
  2990.  
  2991. as implements all the standard H8/500 opcodes.  No additional 
  2992. pseudo-instructions are needed on this family. 
  2993.  
  2994. The following table summarizes H8/500 opcodes and their operands: 
  2995.  
  2996. Legend:
  2997. abs8      8-bit absolute address
  2998. abs16     16-bit absolute address
  2999. abs24     24-bit absolute address
  3000. crb       ccr, br, ep, dp, tp, dp
  3001. disp8     8-bit displacement
  3002. ea        rn, @rn, @(d:8, rn), @(d:16, rn),
  3003.           @-rn, @rn+, @aa:8, @aa:16,
  3004.           #xx:8, #xx:16
  3005. ea_mem    @rn, @(d:8, rn), @(d:16, rn),
  3006.           @-rn, @rn+, @aa:8, @aa:16
  3007. ea_noimm  rn, @rn, @(d:8, rn), @(d:16, rn),
  3008.           @-rn, @rn+, @aa:8, @aa:16
  3009. fp        r6
  3010. imm4      4-bit immediate data
  3011. imm8      8-bit immediate data
  3012. imm16     16-bit immediate data
  3013. pcrel8    8-bit offset from program counter
  3014. pcrel16   16-bit offset from program counter
  3015. qim       -2, -1, 1, 2
  3016. rd        any register
  3017. rs        a register distinct from rd
  3018. rlist     comma-separated list of registers in parentheses;
  3019.           register ranges rd-rs are allowed
  3020. sp        stack pointer (r7)
  3021. sr        status register
  3022. sz        size; `.b' or `.w'.  If omitted, default `.w'
  3023.  
  3024. ldc[.b] ea,crb                 bcc[.w] pcrel16
  3025. ldc[.w] ea,sr                  bcc[.b] pcrel8
  3026. add[:q] sz qim,ea_noimm        bhs[.w] pcrel16
  3027. add[:g] sz ea,rd               bhs[.b] pcrel8
  3028. adds sz ea,rd                  bcs[.w] pcrel16
  3029. addx sz ea,rd                  bcs[.b] pcrel8
  3030. and sz ea,rd                   blo[.w] pcrel16
  3031. andc[.b] imm8,crb              blo[.b] pcrel8
  3032. andc[.w] imm16,sr              bne[.w] pcrel16
  3033. bpt                            bne[.b] pcrel8
  3034. bra[.w] pcrel16                beq[.w] pcrel16
  3035. bra[.b] pcrel8                 beq[.b] pcrel8
  3036. bt[.w] pcrel16                 bvc[.w] pcrel16
  3037. bt[.b] pcrel8                  bvc[.b] pcrel8
  3038. brn[.w] pcrel16                bvs[.w] pcrel16
  3039. brn[.b] pcrel8                 bvs[.b] pcrel8
  3040. bf[.w] pcrel16                 bpl[.w] pcrel16
  3041. bf[.b] pcrel8                  bpl[.b] pcrel8
  3042. bhi[.w] pcrel16                bmi[.w] pcrel16
  3043. bhi[.b] pcrel8                 bmi[.b] pcrel8
  3044. bls[.w] pcrel16                bge[.w] pcrel16
  3045. bls[.b] pcrel8                 bge[.b] pcrel8
  3046.  
  3047. blt[.w] pcrel16                mov[:g][.b] imm8,ea_mem
  3048. blt[.b] pcrel8                 mov[:g][.w] imm16,ea_mem
  3049. bgt[.w] pcrel16                movfpe[.b] ea,rd
  3050. bgt[.b] pcrel8                 movtpe[.b] rs,ea_noimm
  3051. ble[.w] pcrel16                mulxu sz ea,rd
  3052. ble[.b] pcrel8                 neg sz ea
  3053. bclr sz imm4,ea_noimm          nop
  3054. bclr sz rs,ea_noimm            not sz ea
  3055. bnot sz imm4,ea_noimm          or sz ea,rd
  3056. bnot sz rs,ea_noimm            orc[.b] imm8,crb
  3057. bset sz imm4,ea_noimm          orc[.w] imm16,sr
  3058. bset sz rs,ea_noimm            pjmp abs24
  3059. bsr[.b] pcrel8                 pjmp @rd
  3060. bsr[.w] pcrel16                pjsr abs24
  3061. btst sz imm4,ea_noimm          pjsr @rd
  3062. btst sz rs,ea_noimm            prtd imm8
  3063. clr sz ea                      prtd imm16
  3064. cmp[:e][.b] imm8,rd            prts
  3065. cmp[:i][.w] imm16,rd           rotl sz ea
  3066. cmp[:g].b imm8,ea_noimm        rotr sz ea
  3067. cmp[:g][.w] imm16,ea_noimm     rotxl sz ea
  3068. Cmp[:g] sz ea,rd               rotxr sz ea
  3069. dadd rs,rd                     rtd imm8
  3070. divxu sz ea,rd                 rtd imm16
  3071. dsub rs,rd                     rts
  3072. exts[.b] rd                    scb/f rs,pcrel8
  3073. extu[.b] rd                    scb/ne rs,pcrel8
  3074. jmp @rd                        scb/eq rs,pcrel8
  3075. jmp @(imm8,rd)                 shal sz ea
  3076. jmp @(imm16,rd)                shar sz ea
  3077. jmp abs16                      shll sz ea
  3078. jsr @rd                        shlr sz ea
  3079. jsr @(imm8,rd)                 sleep
  3080. jsr @(imm16,rd)                stc[.b] crb,ea_noimm
  3081. jsr abs16                      stc[.w] sr,ea_noimm
  3082. ldm @sp+,(rlist)               stm (rlist),@-sp
  3083. link fp,imm8                   sub sz ea,rd
  3084. link fp,imm16                  subs sz ea,rd
  3085. mov[:e][.b] imm8,rd            subx sz ea,rd
  3086. mov[:i][.w] imm16,rd           swap[.b] rd
  3087. mov[:l][.w] abs8,rd            tas[.b] ea
  3088. mov[:l].b abs8,rd              trapa imm4
  3089. mov[:s][.w] rs,abs8            trap/vs
  3090. mov[:s].b rs,abs8              tst sz ea
  3091. mov[:f][.w] @(disp8,fp),rd     unlk fp
  3092. mov[:f][.w] rs,@(disp8,fp)     xch[.w] rs,rd
  3093. mov[:f].b @(disp8,fp),rd       xor sz ea,rd
  3094. mov[:f].b rs,@(disp8,fp)       xorc.b imm8,crb
  3095. mov[:g] sz rs,ea_mem           xorc.w imm16,sr
  3096. mov[:g] sz ea,rd
  3097.  
  3098.  
  3099. ΓòÉΓòÉΓòÉ 15. HPPA Dependent Features ΓòÉΓòÉΓòÉ
  3100.  
  3101.  HPPA Notes                              Notes 
  3102.  HPPA Options                            Options 
  3103.  HPPA Syntax                             Syntax 
  3104.  HPPA Floating Point                     Floating Point 
  3105.  HPPA Directives                         HPPA Machine Directives 
  3106.  HPPA Opcodes                            Opcodes 
  3107.  
  3108.  
  3109. ΓòÉΓòÉΓòÉ 15.1. Notes ΓòÉΓòÉΓòÉ
  3110.  
  3111. As a back end for gnu cc as has been throughly tested and should work extremely 
  3112. well.  We have tested it only minimally on hand written assembly code and no 
  3113. one has tested it much on the assembly output from the HP compilers. 
  3114.  
  3115. The format of the debugging sections has changed since the original as port 
  3116. (version 1.3X) was released; therefore, you must rebuild all HPPA objects and 
  3117. libraries with the new assembler so that you can debug the final executable. 
  3118.  
  3119. The HPPA as port generates a small subset of the relocations available in the 
  3120. SOM and ELF object file formats.  Additional relocation support will be added 
  3121. as it becomes necessary. 
  3122.  
  3123.  
  3124. ΓòÉΓòÉΓòÉ 15.2. Options ΓòÉΓòÉΓòÉ
  3125.  
  3126. as has no machine-dependent command-line options for the HPPA. 
  3127.  
  3128.  
  3129. ΓòÉΓòÉΓòÉ 15.3. Syntax ΓòÉΓòÉΓòÉ
  3130.  
  3131. The assembler syntax closely follows the HPPA instruction set reference manual; 
  3132. assembler directives and general syntax closely follow the HPPA assembly 
  3133. language reference manual, with a few noteworthy differences. 
  3134.  
  3135. First, a colon may immediately follow a label definition.  This is simply for 
  3136. compatibility with how most assembly language programmers write code. 
  3137.  
  3138. Some obscure expression parsing problems may affect hand written code which 
  3139. uses the spop instructions, or code which makes significant use of the ! line 
  3140. separator. 
  3141.  
  3142. as is much less forgiving about missing arguments and other similar oversights 
  3143. than the HP assembler.  as notifies you of missing arguments as syntax errors; 
  3144. this is regarded as a feature, not a bug. 
  3145.  
  3146. Finally, as allows you to use an external symbol without explicitly importing 
  3147. the symbol.  Warning: in the future this will be an error for HPPA targets. 
  3148.  
  3149. Special characters for HPPA targets include: 
  3150.  
  3151. `;' is the line comment character. 
  3152.  
  3153. `!' can be used instead of a newline to separate statements. 
  3154.  
  3155. Since `$' has no special meaning, you may use it in symbol names. 
  3156.  
  3157.  
  3158. ΓòÉΓòÉΓòÉ 15.4. Floating Point ΓòÉΓòÉΓòÉ
  3159.  
  3160. The HPPA family uses ieee floating-point numbers. 
  3161.  
  3162.  
  3163. ΓòÉΓòÉΓòÉ 15.5. HPPA Assembler Directives ΓòÉΓòÉΓòÉ
  3164.  
  3165. as for the HPPA supports many additional directives for compatibility with the 
  3166. native assembler.  This section describes them only briefly.  For detailed 
  3167. information on HPPA-specific assembler directives, see HP9000 Series 800 
  3168. Assembly Language Reference Manual (HP 92432-90001). 
  3169.  
  3170. as does not support the following assembler directives described in the HP 
  3171. manual: 
  3172.  
  3173. .endm           .liston
  3174. .enter          .locct
  3175. .leave          .macro
  3176. .listoff
  3177.  
  3178. Beyond those implemented for compatibility, as supports one additional 
  3179. assembler directive for the HPPA: .param.  It conveys register argument 
  3180. locations for static functions.  Its syntax closely follows the .export 
  3181. directive. 
  3182.  
  3183. These are the additional directives in as for the HPPA: 
  3184.  
  3185.  .block n 
  3186.  .blockz n 
  3187.            Reserve n bytes of storage, and initialize them to zero. 
  3188.  
  3189.  .call 
  3190.            Mark the beginning of a procedure call.  Only the special case with 
  3191.            no arguments is allowed. 
  3192.  
  3193.  .callinfo [ param=value, ... ]  [ flag, ... ] 
  3194.            Specify a number of parameters and flags that define the environment 
  3195.            for a procedure. 
  3196.  
  3197.            param may be any of `frame' (frame size), `entry_gr' (end of general 
  3198.            register range), `entry_fr' (end of float register range), 
  3199.            `entry_sr' (end of space register range). 
  3200.  
  3201.            The values for flag are `calls' or `caller' (proc has subroutines), 
  3202.            `no_calls' (proc does not call subroutines), `save_rp' (preserve 
  3203.            return pointer), `save_sp' (proc preserves stack pointer), 
  3204.            `no_unwind' (do not unwind this proc), `hpux_int' (proc is interrupt 
  3205.            routine). 
  3206.  
  3207.  .code 
  3208.            Assemble into the standard section called `$TEXT$', subsection 
  3209.            `$CODE$'. 
  3210.  
  3211.  .copyright "string" 
  3212.            In the SOM object format, insert string into the object code, marked 
  3213.            as a copyright string. 
  3214.  
  3215.  .copyright "string" 
  3216.            In the ELF object format, insert string into the object code, marked 
  3217.            as a version string. 
  3218.  
  3219.  .enter 
  3220.            Not yet supported; the assembler rejects programs containing this 
  3221.            directive. 
  3222.  
  3223.  .entry 
  3224.            Mark the beginning of a procedure. 
  3225.  
  3226.  .exit 
  3227.            Mark the end of a procedure. 
  3228.  
  3229.  .export name [ ,typ ]  [ ,param=r ] 
  3230.            Make a procedure name available to callers.  typ, if present, must 
  3231.            be one of `absolute', `code' (ELF only, not SOM), `data', `entry', 
  3232.            `data', `entry', `millicode', `plabel', `pri_prog', or `sec_prog'. 
  3233.  
  3234.            param, if present, provides either relocation information for the 
  3235.            procedure arguments and result, or a privilege level.  param may be 
  3236.            `argwn' (where n ranges from 0 to 3, and indicates one of four 
  3237.            one-word arguments); `rtnval' (the procedure's result); or 
  3238.            `priv_lev' (privilege level).  For arguments or the result, r 
  3239.            specifies how to relocate, and must be one of `no' (not 
  3240.            relocatable), `gr' (argument is in general register), `fr' (in 
  3241.            floating point register), or `fu' (upper half of float register). 
  3242.            For `priv_lev', r is an integer. 
  3243.  
  3244.  .half n 
  3245.            Define a two-byte integer constant n; synonym for the portable as 
  3246.            directive .short. 
  3247.  
  3248.  .import name [ ,typ ] 
  3249.            Converse of .export; make a procedure available to call.  The 
  3250.            arguments use the same conventions as the first two arguments for 
  3251.            .export. 
  3252.  
  3253.  .label name 
  3254.            Define name as a label for the current assembly location. 
  3255.  
  3256.  .leave 
  3257.            Not yet supported; the assembler rejects programs containing this 
  3258.            directive. 
  3259.  
  3260.  .origin lc 
  3261.            Advance location counter to lc. Synonym for the  portable directive 
  3262.            .org. 
  3263.  
  3264.  .param name [ ,typ ]  [ ,param=r ] 
  3265.            Similar to .export, but used for static procedures. 
  3266.  
  3267.  .proc 
  3268.            Use preceding the first statement of a procedure. 
  3269.  
  3270.  .procend 
  3271.            Use following the last statement of a procedure. 
  3272.  
  3273.  label .reg expr 
  3274.            Synonym for .equ; define label with the absolute expression expr as 
  3275.            its value. 
  3276.  
  3277.  .space secname [ ,params ] 
  3278.            Switch to section secname, creating a new section by that name if 
  3279.            necessary.  You may only use params when creating a new section, not 
  3280.            when switching to an existing one.  secname may identify a section 
  3281.            by number rather than by name. 
  3282.  
  3283.            If specified, the list params declares attributes of the section, 
  3284.            identified by keywords.  The keywords recognized are `spnum=exp' 
  3285.            (identify this section by the number exp, an absolute expression), 
  3286.            `sort=exp' (order sections according to this sort key when linking; 
  3287.            exp is an absolute expression), `unloadable' (section contains no 
  3288.            loadable data), `notdefined' (this section defined elsewhere), and 
  3289.            `private' (data in this section not available to other programs). 
  3290.  
  3291.  .spnum secnam 
  3292.            Allocate four bytes of storage, and initialize them with the section 
  3293.            number of the section named secnam.  (You can define the section 
  3294.            number with the HPPA .space directive.) 
  3295.  
  3296.  .string "str" 
  3297.            Copy the characters in the string str to the object file. See 
  3298.            Strings, for information on escape sequences you can use in as 
  3299.            strings. 
  3300.  
  3301.            Warning! The HPPA version of .string differs from the usual as 
  3302.            definition: it does not write a zero byte after copying str. 
  3303.  
  3304.  .stringz "str" 
  3305.            Like .string, but appends a zero byte after copying str to object 
  3306.            file. 
  3307.  
  3308.  .subspa name [ ,params ] 
  3309.            Similar to .space, but selects a subsection name within the current 
  3310.            section.  You may only specify params when you create a subsection 
  3311.            (in the first instance of .subspa for this name). 
  3312.  
  3313.            If specified, the list params declares attributes of the subsection, 
  3314.            identified by keywords.  The keywords recognized are `quad=expr' 
  3315.            (``quadrant'' for this subsection), `align=expr' (alignment for 
  3316.            beginning of this subsection; a power of two), `access=expr' (value 
  3317.            for ``access rights'' field), `sort=expr' (sorting order for this 
  3318.            subspace in link), `code_only' (subsection contains only code), 
  3319.            `unloadable' (subsection cannot be loaded into memory), `common' 
  3320.            (subsection is common block), `dup_comm' (initialized data may have 
  3321.            duplicate names), or `zero' (subsection is all zeros, do not write 
  3322.            in object file). 
  3323.  
  3324.  .version "str" 
  3325.            Write str as version identifier in object code. 
  3326.  
  3327.  
  3328. ΓòÉΓòÉΓòÉ 15.6. Opcodes ΓòÉΓòÉΓòÉ
  3329.  
  3330. For detailed information on the HPPA machine instruction set, see PA-RISC 
  3331. Architecture and Instruction Set Reference Manual (HP 09740-90039). 
  3332.  
  3333.  
  3334. ΓòÉΓòÉΓòÉ 16. Hitachi SH Dependent Features ΓòÉΓòÉΓòÉ
  3335.  
  3336.  SH Options                              Options 
  3337.  SH Syntax                               Syntax 
  3338.  SH Floating Point                       Floating Point 
  3339.  SH Directives                           SH Machine Directives 
  3340.  SH Opcodes                              Opcodes 
  3341.  
  3342.  
  3343. ΓòÉΓòÉΓòÉ 16.1. Options ΓòÉΓòÉΓòÉ
  3344.  
  3345. as has no additional command-line options for the Hitachi SH family. 
  3346.  
  3347.  
  3348. ΓòÉΓòÉΓòÉ 16.2. Syntax ΓòÉΓòÉΓòÉ
  3349.  
  3350.  SH-Chars                                Special Characters 
  3351.  SH-Regs                                 Register Names 
  3352.  SH-Addressing                           Addressing Modes 
  3353.  
  3354.  
  3355. ΓòÉΓòÉΓòÉ 16.2.1. Special Characters ΓòÉΓòÉΓòÉ
  3356.  
  3357. `!' is the line comment character. 
  3358.  
  3359. You can use `;' instead of a newline to separate statements. 
  3360.  
  3361. Since `$' has no special meaning, you may use it in symbol names. 
  3362.  
  3363.  
  3364. ΓòÉΓòÉΓòÉ 16.2.2. Register Names ΓòÉΓòÉΓòÉ
  3365.  
  3366. You can use the predefined symbols `r0', `r1', `r2', `r3', `r4', `r5', `r6', 
  3367. `r7', `r8', `r9', `r10', `r11', `r12', `r13', `r14', and `r15' to refer to the 
  3368. SH registers. 
  3369.  
  3370. The SH also has these control registers: 
  3371.  
  3372.  pr 
  3373.            procedure register (holds return address) 
  3374.  
  3375.  pc 
  3376.            program counter 
  3377.  
  3378.  mach 
  3379.  macl 
  3380.            high and low multiply accumulator registers 
  3381.  
  3382.  sr 
  3383.            status register 
  3384.  
  3385.  gbr 
  3386.            global base register 
  3387.  
  3388.  vbr 
  3389.            vector base register (for interrupt vectors) 
  3390.  
  3391.  
  3392. ΓòÉΓòÉΓòÉ 16.2.3. Addressing Modes ΓòÉΓòÉΓòÉ
  3393.  
  3394. as understands the following addressing modes for the SH. Rn in the following 
  3395. refers to any of the numbered registers, but not the control registers. 
  3396.  
  3397.  Rn 
  3398.            Register direct 
  3399.  
  3400.  @Rn 
  3401.            Register indirect 
  3402.  
  3403.  @-Rn 
  3404.            Register indirect with pre-decrement 
  3405.  
  3406.  @Rn+ 
  3407.            Register indirect with post-increment 
  3408.  
  3409.  @(disp, Rn) 
  3410.            Register indirect with displacement 
  3411.  
  3412.  @(R0, Rn) 
  3413.            Register indexed 
  3414.  
  3415.  @(disp, GBR) 
  3416.            GBR offset 
  3417.  
  3418.  @(R0, GBR) 
  3419.            GBR indexed 
  3420.  
  3421.  addr 
  3422.  @(disp, PC) 
  3423.            PC relative address (for branch or for addressing memory).  The as 
  3424.            implementation allows you to use the simpler form addr anywhere a PC 
  3425.            relative address is called for; the alternate form is supported for 
  3426.            compatibility with other assemblers. 
  3427.  
  3428.  #imm 
  3429.            Immediate data 
  3430.  
  3431.  
  3432. ΓòÉΓòÉΓòÉ 16.3. Floating Point ΓòÉΓòÉΓòÉ
  3433.  
  3434. The SH family uses ieee floating-point numbers. 
  3435.  
  3436.  
  3437. ΓòÉΓòÉΓòÉ 16.4. SH Machine Directives ΓòÉΓòÉΓòÉ
  3438.  
  3439. as has no machine-dependent directives for the SH. 
  3440.  
  3441.  
  3442. ΓòÉΓòÉΓòÉ 16.5. Opcodes ΓòÉΓòÉΓòÉ
  3443.  
  3444. For detailed information on the SH machine instruction set, see 
  3445. SH-Microcomputer User's Manual (Hitachi Micro Systems, Inc.). 
  3446.  
  3447. as implements all the standard SH opcodes.  No additional pseudo-instructions 
  3448. are needed on this family.  Note, however, that because as supports a simpler 
  3449. form of PC-relative addressing, you may simply write (for example) 
  3450.  
  3451. mov.l  bar,r0
  3452.  
  3453. where other assemblers might require an explicit displacement to bar from the 
  3454. program counter: 
  3455.  
  3456. mov.l  @(disp, PC)
  3457.  
  3458. Here is a summary of SH opcodes: 
  3459.  
  3460. Legend:
  3461. Rn        a numbered register
  3462. Rm        another numbered register
  3463. #imm      immediate data
  3464. disp      displacement
  3465. disp8     8-bit displacement
  3466. disp12    12-bit displacement
  3467.  
  3468. add #imm,Rn                    lds.l @Rn+,PR
  3469. add Rm,Rn                      mac.w @Rm+,@Rn+
  3470. addc Rm,Rn                     mov #imm,Rn
  3471. addv Rm,Rn                     mov Rm,Rn
  3472. and #imm,R0                    mov.b Rm,@(R0,Rn)
  3473. and Rm,Rn                      mov.b Rm,@-Rn
  3474. and.b #imm,@(R0,GBR)           mov.b Rm,@Rn
  3475. bf disp8                       mov.b @(disp,Rm),R0
  3476. bra disp12                     mov.b @(disp,GBR),R0
  3477. bsr disp12                     mov.b @(R0,Rm),Rn
  3478. bt disp8                       mov.b @Rm+,Rn
  3479. clrmac                         mov.b @Rm,Rn
  3480. clrt                           mov.b R0,@(disp,Rm)
  3481. cmp/eq #imm,R0                 mov.b R0,@(disp,GBR)
  3482. cmp/eq Rm,Rn                   mov.l Rm,@(disp,Rn)
  3483. cmp/ge Rm,Rn                   mov.l Rm,@(R0,Rn)
  3484. cmp/gt Rm,Rn                   mov.l Rm,@-Rn
  3485. cmp/hi Rm,Rn                   mov.l Rm,@Rn
  3486. cmp/hs Rm,Rn                   mov.l @(disp,Rn),Rm
  3487. cmp/pl Rn                      mov.l @(disp,GBR),R0
  3488. cmp/pz Rn                      mov.l @(disp,PC),Rn
  3489. cmp/str Rm,Rn                  mov.l @(R0,Rm),Rn
  3490. div0s Rm,Rn                    mov.l @Rm+,Rn
  3491. div0u                          mov.l @Rm,Rn
  3492. div1 Rm,Rn                     mov.l R0,@(disp,GBR)
  3493. exts.b Rm,Rn                   mov.w Rm,@(R0,Rn)
  3494. exts.w Rm,Rn                   mov.w Rm,@-Rn
  3495. extu.b Rm,Rn                   mov.w Rm,@Rn
  3496. extu.w Rm,Rn                   mov.w @(disp,Rm),R0
  3497. jmp @Rn                        mov.w @(disp,GBR),R0
  3498. jsr @Rn                        mov.w @(disp,PC),Rn
  3499. ldc Rn,GBR                     mov.w @(R0,Rm),Rn
  3500. ldc Rn,SR                      mov.w @Rm+,Rn
  3501. ldc Rn,VBR                     mov.w @Rm,Rn
  3502. ldc.l @Rn+,GBR                 mov.w R0,@(disp,Rm)
  3503. ldc.l @Rn+,SR                  mov.w R0,@(disp,GBR)
  3504. ldc.l @Rn+,VBR                 mova @(disp,PC),R0
  3505. lds Rn,MACH                    movt Rn
  3506. lds Rn,MACL                    muls Rm,Rn
  3507. lds Rn,PR                      mulu Rm,Rn
  3508. lds.l @Rn+,MACH                neg Rm,Rn
  3509. lds.l @Rn+,MACL                negc Rm,Rn
  3510.  
  3511. nop                            stc VBR,Rn
  3512. not Rm,Rn                      stc.l GBR,@-Rn
  3513. or #imm,R0                     stc.l SR,@-Rn
  3514. or Rm,Rn                       stc.l VBR,@-Rn
  3515. or.b #imm,@(R0,GBR)            sts MACH,Rn
  3516. rotcl Rn                       sts MACL,Rn
  3517. rotcr Rn                       sts PR,Rn
  3518. rotl Rn                        sts.l MACH,@-Rn
  3519. rotr Rn                        sts.l MACL,@-Rn
  3520. rte                            sts.l PR,@-Rn
  3521. rts                            sub Rm,Rn
  3522. sett                           subc Rm,Rn
  3523. shal Rn                        subv Rm,Rn
  3524. shar Rn                        swap.b Rm,Rn
  3525. shll Rn                        swap.w Rm,Rn
  3526. shll16 Rn                      tas.b @Rn
  3527. shll2 Rn                       trapa #imm
  3528. shll8 Rn                       tst #imm,R0
  3529. shlr Rn                        tst Rm,Rn
  3530. shlr16 Rn                      tst.b #imm,@(R0,GBR)
  3531. shlr2 Rn                       xor #imm,R0
  3532. shlr8 Rn                       xor Rm,Rn
  3533. sleep                          xor.b #imm,@(R0,GBR)
  3534. stc GBR,Rn                     xtrct Rm,Rn
  3535. stc SR,Rn
  3536.  
  3537.  
  3538. ΓòÉΓòÉΓòÉ 17. Intel 80960 Dependent Features ΓòÉΓòÉΓòÉ
  3539.  
  3540.  Options-i960                            i960 Command-line Options 
  3541.  Floating Point-i960                     Floating Point 
  3542.  Directives-i960                         i960 Machine Directives 
  3543.  Opcodes for i960                        i960 Opcodes 
  3544.  
  3545.  
  3546. ΓòÉΓòÉΓòÉ 17.1. i960 Command-line Options ΓòÉΓòÉΓòÉ
  3547.  
  3548.  -ACA | -ACA_A | -ACB | -ACC | -AKA | -AKB | -AKC | -AMC 
  3549.            Select the 80960 architecture.  Instructions or features not 
  3550.            supported by the selected architecture cause fatal errors. 
  3551.  
  3552.            `-ACA' is equivalent to `-ACA_A'; `-AKC' is equivalent to `-AMC'. 
  3553.            Synonyms are provided for compatibility with other tools. 
  3554.  
  3555.            If you do not specify any of these options, as generates code for 
  3556.            any instruction or feature that is supported by some version of the 
  3557.            960 (even if this means mixing architectures!).  In principle, as 
  3558.            attempts to deduce the minimal sufficient processor type if none is 
  3559.            specified; depending on the object code format, the processor type 
  3560.            may be recorded in the object file.  If it is critical that the as 
  3561.            output match a specific architecture, specify that architecture 
  3562.            explicitly. 
  3563.  
  3564.  -b 
  3565.            Add code to collect information about conditional branches taken, 
  3566.            for later optimization using branch prediction bits.  (The 
  3567.            conditional branch instructions have branch prediction bits in the 
  3568.            CA, CB, and CC architectures.)  If BR represents a conditional 
  3569.            branch instruction, the following represents the code generated by 
  3570.            the assembler when `-b' is specified: 
  3571.  
  3572.                               call    increment routine
  3573.                               .word   0       # pre-counter
  3574.                       Label:  BR
  3575.                               call    increment routine
  3576.                               .word   0       # post-counter
  3577.  
  3578.            The counter following a branch records the number of times that 
  3579.            branch was not taken; the differenc between the two counters is the 
  3580.            number of times the branch was taken. 
  3581.  
  3582.            A table of every such Label is also generated, so that the external 
  3583.            postprocessor gbr960 (supplied by Intel) can locate all the 
  3584.            counters.  This table is always labelled `__BRANCH_TABLE__'; this is 
  3585.            a local symbol to permit collecting statistics for many separate 
  3586.            object files.  The table is word aligned, and begins with a two-word 
  3587.            header.  The first word, initialized to 0, is used in maintaining 
  3588.            linked lists of branch tables.  The second word is a count of the 
  3589.            number of entries in the table, which follow immediately: each is a 
  3590.            word, pointing to one of the labels illustrated above. 
  3591.  
  3592.                        +------------+------------+------------+ ... +------------+
  3593.                        |            |            |            |     |            |
  3594.                        |  *NEXT     |  COUNT: N  | *BRLAB 1   |     | *BRLAB N   |
  3595.                        |            |            |            |     |            |
  3596.                        +------------+------------+------------+ ... +------------+
  3597.  
  3598.                                      __BRANCH_TABLE__ layout
  3599.  
  3600.            The first word of the header is used to locate multiple branch 
  3601.            tables, since each object file may contain one. Normally the links 
  3602.            are maintained with a call to an initialization routine, placed at 
  3603.            the beginning of each function in the file.  The gnu C compiler 
  3604.            generates these calls automatically when you give it a `-b' option. 
  3605.            For further details, see the documentation of `gbr960'. 
  3606.  
  3607.  -norelax 
  3608.            Normally, Compare-and-Branch instructions with targets that require 
  3609.            displacements greater than 13 bits (or that have external targets) 
  3610.            are replaced with the corresponding compare (or `chkbit') and branch 
  3611.            instructions.  You can use the `-norelax' option to specify that as 
  3612.            should generate errors instead, if the target displacement is larger 
  3613.            than 13 bits. 
  3614.  
  3615.            This option does not affect the Compare-and-Jump instructions; the 
  3616.            code emitted for them is always adjusted when necessary (depending 
  3617.            on displacement size), regardless of whether you use `-norelax'. 
  3618.  
  3619.  
  3620. ΓòÉΓòÉΓòÉ 17.2. Floating Point ΓòÉΓòÉΓòÉ
  3621.  
  3622. as generates ieee floating-point numbers for the directives `.float', 
  3623. `.double', `.extended', and `.single'. 
  3624.  
  3625.  
  3626. ΓòÉΓòÉΓòÉ 17.3. i960 Machine Directives ΓòÉΓòÉΓòÉ
  3627.  
  3628.  .bss symbol, length, align 
  3629.            Reserve length bytes in the bss section for a local symbol, aligned 
  3630.            to the power of two specified by align.  length and align must be 
  3631.            positive absolute expressions.  This directive differs from `.lcomm' 
  3632.            only in that it permits you to specify an alignment.  See .lcomm. 
  3633.  
  3634.  .extended flonums 
  3635.            .extended expects zero or more flonums, separated by commas; for 
  3636.            each flonum, `.extended' emits an ieee extended-format (80-bit) 
  3637.            floating-point number. 
  3638.  
  3639.  .leafproc call-lab, bal-lab 
  3640.            You can use the `.leafproc' directive in conjunction with the 
  3641.            optimized callj instruction to enable faster calls of leaf 
  3642.            procedures.  If a procedure is known to call no other procedures, 
  3643.            you may define an entry point that skips procedure prolog code (and 
  3644.            that does not depend on system-supplied saved context), and declare 
  3645.            it as the bal-lab using `.leafproc'.  If the procedure also has an 
  3646.            entry point that goes through the normal prolog, you can specify 
  3647.            that entry point as call-lab. 
  3648.  
  3649.            A `.leafproc' declaration is meant for use in conjunction with the 
  3650.            optimized call instruction `callj'; the directive records the data 
  3651.            needed later to choose between converting the `callj' into a bal or 
  3652.            a call. 
  3653.  
  3654.            call-lab is optional; if only one argument is present, or if the two 
  3655.            arguments are identical, the single argument is assumed to be the 
  3656.            bal entry point. 
  3657.  
  3658.  .sysproc name, index 
  3659.            The `.sysproc' directive defines a name for a system procedure. 
  3660.            After you define it using `.sysproc', you can use name to refer to 
  3661.            the system procedure identified by index when calling procedures 
  3662.            with the optimized call instruction `callj'. 
  3663.  
  3664.            Both arguments are required; index must be between 0 and 31 
  3665.            (inclusive). 
  3666.  
  3667.  
  3668. ΓòÉΓòÉΓòÉ 17.4. i960 Opcodes ΓòÉΓòÉΓòÉ
  3669.  
  3670. All Intel 960 machine instructions are supported; see i960 Command-line Options 
  3671. for a discussion of selecting the instruction subset for a particular 960 
  3672. architecture. 
  3673.  
  3674. Some opcodes are processed beyond simply emitting a single corresponding 
  3675. instruction: `callj', and Compare-and-Branch or Compare-and-Jump instructions 
  3676. with target displacements larger than 13 bits. 
  3677.  
  3678.  callj-i960                              callj 
  3679.  Compare-and-branch-i960                 Compare-and-Branch 
  3680.  
  3681.  
  3682. ΓòÉΓòÉΓòÉ 17.4.1. callj ΓòÉΓòÉΓòÉ
  3683.  
  3684. You can write callj to have the assembler or the linker determine the most 
  3685. appropriate form of subroutine call: `call', `bal', or `calls'.  If the 
  3686. assembly source contains enough information---a `.leafproc' or `.sysproc' 
  3687. directive defining the operand---then as translates the callj; if not, it 
  3688. simply emits the callj, leaving it for the linker to resolve. 
  3689.  
  3690.  
  3691. ΓòÉΓòÉΓòÉ 17.4.2. Compare-and-Branch ΓòÉΓòÉΓòÉ
  3692.  
  3693. The 960 architectures provide combined Compare-and-Branch instructions that 
  3694. permit you to store the branch target in the lower 13 bits of the instruction 
  3695. word itself.  However, if you specify a branch target far enough away that its 
  3696. address won't fit in 13 bits, the assembler can either issue an error, or 
  3697. convert your Compare-and-Branch instruction into separate instructions to do 
  3698. the compare and the branch. 
  3699.  
  3700. Whether as gives an error or expands the instruction depends on two choices you 
  3701. can make: whether you use the `-norelax' option, and whether you use a 
  3702. ``Compare and Branch'' instruction or a ``Compare and Jump'' instruction.  The 
  3703. ``Jump'' instructions are always expanded if necessary; the ``Branch'' 
  3704. instructions are expanded when necessary unless you specify -norelax---in which 
  3705. case as gives an error instead. 
  3706.  
  3707. These are the Compare-and-Branch instructions, their ``Jump'' variants, and the 
  3708. instruction pairs they may expand into: 
  3709.  
  3710.         Compare and
  3711.      Branch      Jump       Expanded to
  3712.      ------    ------       ------------
  3713.         bbc                 chkbit; bno
  3714.         bbs                 chkbit; bo
  3715.      cmpibe    cmpije       cmpi; be
  3716.      cmpibg    cmpijg       cmpi; bg
  3717.     cmpibge   cmpijge       cmpi; bge
  3718.      cmpibl    cmpijl       cmpi; bl
  3719.     cmpible   cmpijle       cmpi; ble
  3720.     cmpibno   cmpijno       cmpi; bno
  3721.     cmpibne   cmpijne       cmpi; bne
  3722.      cmpibo    cmpijo       cmpi; bo
  3723.      cmpobe    cmpoje       cmpo; be
  3724.      cmpobg    cmpojg       cmpo; bg
  3725.     cmpobge   cmpojge       cmpo; bge
  3726.      cmpobl    cmpojl       cmpo; bl
  3727.     cmpoble   cmpojle       cmpo; ble
  3728.     cmpobne   cmpojne       cmpo; bne
  3729.  
  3730.  
  3731. ΓòÉΓòÉΓòÉ 18. M680x0 Dependent Features ΓòÉΓòÉΓòÉ
  3732.  
  3733.  M68K-Opts                               M680x0 Options 
  3734.  M68K-Syntax                             Syntax 
  3735.  M68K-Moto-Syntax                        Motorola Syntax 
  3736.  M68K-Float                              Floating Point 
  3737.  M68K-Directives                         680x0 Machine Directives 
  3738.  M68K-opcodes                            Opcodes 
  3739.  
  3740.  
  3741. ΓòÉΓòÉΓòÉ 18.1. M680x0 Options ΓòÉΓòÉΓòÉ
  3742.  
  3743. The Motorola 680x0 version of as has two machine dependent options. One 
  3744. shortens undefined references from 32 to 16 bits, while the other is used to 
  3745. tell as what kind of machine it is assembling for. 
  3746.  
  3747. You can use the `-l' option to shorten the size of references to undefined 
  3748. symbols.  If you do not use the `-l' option, references to undefined symbols 
  3749. are wide enough for a full long (32 bits).  (Since as cannot know where these 
  3750. symbols end up, as can only allocate space for the linker to fill in later. 
  3751. Since as does not know how far away these symbols are, it allocates as much 
  3752. space as it can.)  If you use this option, the references are only one word 
  3753. wide (16 bits). This may be useful if you want the object file to be as small 
  3754. as possible, and you know that the relevant symbols are always less than 17 
  3755. bits away. 
  3756.  
  3757. The 680x0 version of as is most frequently used to assemble programs for the 
  3758. Motorola MC68020 microprocessor.  Occasionally it is used to assemble programs 
  3759. for the mostly similar, but slightly different MC68000 or MC68010 
  3760. microprocessors.  You can give as the options `-m68000', `-mc68000', `-m68010', 
  3761. `-mc68010', `-m68020', and `-mc68020' to tell it what processor is the target. 
  3762.  
  3763.  
  3764. ΓòÉΓòÉΓòÉ 18.2. Syntax ΓòÉΓòÉΓòÉ
  3765.  
  3766. This syntax for the Motorola 680x0 was developed at mit. 
  3767.  
  3768. The 680x0 version of as uses syntax compatible with the Sun assembler. 
  3769. Intervening periods are ignored; for example, `movl' is equivalent to `move.l'. 
  3770.  
  3771. In the following table apc stands for any of the address registers (`a0' 
  3772. through `a7'), nothing, (`'), the Program Counter (`pc'), or the zero-address 
  3773. relative to the program counter (`zpc'). 
  3774.  
  3775. The following addressing modes are understood: 
  3776.  
  3777.  Immediate 
  3778.            `#digits' 
  3779.  
  3780.  Data Register 
  3781.            `d0' through `d7' 
  3782.  
  3783.  Address Register 
  3784.            `a0' through `a7' 
  3785.            `a7' is also known as `sp', i.e. the Stack Pointer.  a6 is also 
  3786.            known as `fp', the Frame Pointer. 
  3787.  
  3788.  Address Register Indirect 
  3789.            `a0@' through `a7@' 
  3790.  
  3791.  Address Register Postincrement 
  3792.            `a0@+' through `a7@+' 
  3793.  
  3794.  Address Register Predecrement 
  3795.            `a0@-' through `a7@-' 
  3796.  
  3797.  Indirect Plus Offset 
  3798.            `apc@(digits)' 
  3799.  
  3800.  Index 
  3801.            `apc@(digits,register:size:scale)' 
  3802.  
  3803.            or `apc@(register:size:scale)' 
  3804.  
  3805.  Postindex 
  3806.            `apc@(digits)@(digits,register:size:scale)' 
  3807.  
  3808.            or `apc@(digits)@(register:size:scale)' 
  3809.  
  3810.  Preindex 
  3811.            `apc@(digits,register:size:scale)@(digits)' 
  3812.  
  3813.            or `apc@(register:size:scale)@(digits)' 
  3814.  
  3815.  Memory Indirect 
  3816.            `apc@(digits)@(digits)' 
  3817.  
  3818.  Absolute 
  3819.            `symbol', or `digits' 
  3820.  
  3821.  For some configurations, especially those where the compiler normally does not 
  3822.  prepend an underscore to the names of user variables, the assembler requires a 
  3823.  `%' before any use of a register name.  This is intended to let the assembler 
  3824.  distinguish between user variables and registers named `a0' through `a7', and 
  3825.  so on.  The `%' is always accepted, but is only required for some 
  3826.  configurations, notably `m68k-coff'. 
  3827.  
  3828.  
  3829. ΓòÉΓòÉΓòÉ 18.3. Motorola Syntax ΓòÉΓòÉΓòÉ
  3830.  
  3831. The standard Motorola syntax for this chip differs from the syntax already 
  3832. discussed (see Syntax).  as can accept both kinds of syntax, even within a 
  3833. single instruction.  The two kinds of syntax are fully compatible. 
  3834.  
  3835. In particular, you may write or generate M68K assembler with the following 
  3836. conventions: 
  3837.  
  3838. (In the following table apc stands for any of the address registers (`a0' 
  3839. through `a7'), nothing, (`'), the Program Counter (`pc'), or the zero-address 
  3840. relative to the program counter (`zpc').) 
  3841.  
  3842. The following additional addressing modes are understood: 
  3843.  
  3844.  Address Register Indirect 
  3845.            `a0' through `a7' 
  3846.            `a7' is also known as `sp', i.e. the Stack Pointer.  a6 is also 
  3847.            known as `fp', the Frame Pointer. 
  3848.  
  3849.  Address Register Postincrement 
  3850.            `(a0)+' through `(a7)+' 
  3851.  
  3852.  Address Register Predecrement 
  3853.            `-(a0)' through `-(a7)' 
  3854.  
  3855.  Indirect Plus Offset 
  3856.            `digits(apc)' 
  3857.  
  3858.  Index 
  3859.            `digits(apc,(register.size*scale)' 
  3860.            or `(apc,register.size*scale)' 
  3861.            In either case, size and scale are optional (scale defaults to `1', 
  3862.            size defaults to `l').  scale can be `1', `2', `4', or `8'.  size 
  3863.            can be `w' or `l'.  scale is only supported on the 68020 and 
  3864.            greater. 
  3865.  
  3866.  
  3867. ΓòÉΓòÉΓòÉ 18.4. Floating Point ΓòÉΓòÉΓòÉ
  3868.  
  3869. The floating point code is not too well tested, and may have subtle bugs in it. 
  3870.  
  3871. Packed decimal (P) format floating literals are not supported. Feel free to add 
  3872. the code! 
  3873.  
  3874. The floating point formats generated by directives are these. 
  3875.  
  3876.  .float 
  3877.            Single precision floating point constants. 
  3878.  
  3879.  .double 
  3880.            Double precision floating point constants. 
  3881.  
  3882.  There is no directive to produce regions of memory holding extended precision 
  3883.  numbers, however they can be used as immediate operands to floating-point 
  3884.  instructions.  Adding a directive to create extended precision numbers would 
  3885.  not be hard, but it has not yet seemed necessary. 
  3886.  
  3887.  
  3888. ΓòÉΓòÉΓòÉ 18.5. 680x0 Machine Directives ΓòÉΓòÉΓòÉ
  3889.  
  3890. In order to be compatible with the Sun assembler the 680x0 assembler 
  3891. understands the following directives. 
  3892.  
  3893.  .data1 
  3894.            This directive is identical to a .data 1 directive. 
  3895.  
  3896.  .data2 
  3897.            This directive is identical to a .data 2 directive. 
  3898.  
  3899.  .even 
  3900.            This directive is identical to a .align 1 directive. 
  3901.  
  3902.  .skip 
  3903.            This directive is identical to a .space directive. 
  3904.  
  3905.  
  3906. ΓòÉΓòÉΓòÉ 18.6. Opcodes ΓòÉΓòÉΓòÉ
  3907.  
  3908.  M68K-Branch                             Branch Improvement 
  3909.  M68K-Chars                              Special Characters 
  3910.  
  3911.  
  3912. ΓòÉΓòÉΓòÉ 18.6.1. Branch Improvement ΓòÉΓòÉΓòÉ
  3913.  
  3914. Certain pseudo opcodes are permitted for branch instructions. They expand to 
  3915. the shortest branch instruction that reach the target.  Generally these 
  3916. mnemonics are made by substituting `j' for `b' at the start of a Motorola 
  3917. mnemonic. 
  3918.  
  3919. The following table summarizes the pseudo-operations.  A * flags cases that are 
  3920. more fully described after the table: 
  3921.  
  3922.           Displacement
  3923.           +-------------------------------------------------
  3924.           |                68020   68000/10
  3925. Pseudo-Op |BYTE    WORD    LONG    LONG      non-PC relative
  3926.           +-------------------------------------------------
  3927.      jbsr |bsrs    bsr     bsrl    jsr       jsr
  3928.       jra |bras    bra     bral    jmp       jmp
  3929. *     jXX |bXXs    bXX     bXXl    bNXs;jmpl bNXs;jmp
  3930. *    dbXX |dbXX    dbXX        dbXX; bra; jmpl
  3931. *    fjXX |fbXXw   fbXXw   fbXXl             fbNXw;jmp
  3932.  
  3933. XX: condition
  3934. NX: negative of condition XX
  3935.  
  3936.                          *---see full description below
  3937.  
  3938.  jbsr 
  3939.  jra 
  3940.            These are the simplest jump pseudo-operations; they always map to 
  3941.            one particular machine instruction, depending on the displacement to 
  3942.            the branch target. 
  3943.  
  3944.  jXX 
  3945.            Here, `jXX' stands for an entire family of pseudo-operations, where 
  3946.            XX is a conditional branch or condition-code test.  The full list of 
  3947.            pseudo-ops in this family is: 
  3948.  
  3949.                        jhi   jls   jcc   jcs   jne   jeq   jvc
  3950.                        jvs   jpl   jmi   jge   jlt   jgt   jle
  3951.  
  3952.            For the cases of non-PC relative displacements and long 
  3953.            displacements on the 68000 or 68010, as issues a longer code 
  3954.            fragment in terms of NX, the opposite condition to XX.  For example, 
  3955.            for the non-PC relative case: 
  3956.  
  3957.                           jXX foo
  3958.  
  3959.            gives 
  3960.  
  3961.                            bNXs oof
  3962.                            jmp foo
  3963.                        oof:
  3964.  
  3965.  dbXX 
  3966.            The full family of pseudo-operations covered here is 
  3967.  
  3968.                        dbhi   dbls   dbcc   dbcs   dbne   dbeq   dbvc
  3969.                        dbvs   dbpl   dbmi   dbge   dblt   dbgt   dble
  3970.                        dbf    dbra   dbt
  3971.  
  3972.            Other than for word and byte displacements, when the source reads 
  3973.            `dbXX foo', as emits 
  3974.  
  3975.                            dbXX oo1
  3976.                            bra oo2
  3977.                        oo1:jmpl foo
  3978.                        oo2:
  3979.  
  3980.  fjXX 
  3981.            This family includes 
  3982.  
  3983.                        fjne   fjeq   fjge   fjlt   fjgt   fjle   fjf
  3984.                        fjt    fjgl   fjgle  fjnge  fjngl  fjngle fjngt
  3985.                        fjnle  fjnlt  fjoge  fjogl  fjogt  fjole  fjolt
  3986.                        fjor   fjseq  fjsf   fjsne  fjst   fjueq  fjuge
  3987.                        fjugt  fjule  fjult  fjun
  3988.  
  3989.            For branch targets that are not PC relative, as emits 
  3990.  
  3991.                            fbNX oof
  3992.                            jmp foo
  3993.                        oof:
  3994.  
  3995.            when it encounters `fjXX foo'. 
  3996.  
  3997.  
  3998. ΓòÉΓòÉΓòÉ 18.6.2. Special Characters ΓòÉΓòÉΓòÉ
  3999.  
  4000. The immediate character is `#' for Sun compatibility.  The line-comment 
  4001. character is `|'.  If a `#' appears at the beginning of a line, it is treated 
  4002. as a comment unless it looks like `# line file', in which case it is treated 
  4003. normally. 
  4004.  
  4005.  
  4006. ΓòÉΓòÉΓòÉ 19. SPARC Dependent Features ΓòÉΓòÉΓòÉ
  4007.  
  4008.  Sparc-Opts                              Options 
  4009.  Sparc-Float                             Floating Point 
  4010.  Sparc-Directives                        Sparc Machine Directives 
  4011.  
  4012.  
  4013. ΓòÉΓòÉΓòÉ 19.1. Options ΓòÉΓòÉΓòÉ
  4014.  
  4015. The SPARC chip family includes several successive levels (or other variants) of 
  4016. chip, using the same core instruction set, but including a few additional 
  4017. instructions at each level. 
  4018.  
  4019. By default, as assumes the core instruction set (SPARC v6), but ``bumps'' the 
  4020. architecture level as needed: it switches to successively higher architectures 
  4021. as it encounters instructions that only exist in the higher levels. 
  4022.  
  4023.  -Av6 | -Av7 | -Av8 | -Asparclite 
  4024.            Use one of the `-A' options to select one of the SPARC architectures 
  4025.            explicitly.  If you select an architecture explicitly, as reports a 
  4026.            fatal error if it encounters an instruction or feature requiring a 
  4027.            higher level. 
  4028.  
  4029.  -bump 
  4030.            Permit the assembler to ``bump'' the architecture level as required, 
  4031.            but warn whenever it is necessary to switch to another level. 
  4032.  
  4033.  
  4034. ΓòÉΓòÉΓòÉ 19.2. Floating Point ΓòÉΓòÉΓòÉ
  4035.  
  4036. The Sparc uses ieee floating-point numbers. 
  4037.  
  4038.  
  4039. ΓòÉΓòÉΓòÉ 19.3. Sparc Machine Directives ΓòÉΓòÉΓòÉ
  4040.  
  4041. The Sparc version of as supports the following additional machine directives: 
  4042.  
  4043.  .common 
  4044.            This must be followed by a symbol name, a positive number, and 
  4045.            "bss".  This behaves somewhat like .comm, but the syntax is 
  4046.            different. 
  4047.  
  4048.  .half 
  4049.            This is functionally identical to .short. 
  4050.  
  4051.  .proc 
  4052.            This directive is ignored.  Any text following it on the same line 
  4053.            is also ignored. 
  4054.  
  4055.  .reserve 
  4056.            This must be followed by a symbol name, a positive number, and 
  4057.            "bss".  This behaves somewhat like .lcomm, but the syntax is 
  4058.            different. 
  4059.  
  4060.  .seg 
  4061.            This must be followed by "text", "data", or "data1".  It behaves 
  4062.            like .text, .data, or .data 1. 
  4063.  
  4064.  .skip 
  4065.            This is functionally identical to the .space directive. 
  4066.  
  4067.  .word 
  4068.            On the Sparc, the .word directive produces 32 bit values, instead of 
  4069.            the 16 bit values it produces on many other machines. 
  4070.  
  4071.  
  4072. ΓòÉΓòÉΓòÉ 20. 80386 Dependent Features ΓòÉΓòÉΓòÉ
  4073.  
  4074.  i386-Options                            Options 
  4075.  i386-Syntax                             AT&T Syntax versus Intel Syntax 
  4076.  i386-Opcodes                            Opcode Naming 
  4077.  i386-Regs                               Register Naming 
  4078.  i386-prefixes                           Opcode Prefixes 
  4079.  i386-Memory                             Memory References 
  4080.  i386-jumps                              Handling of Jump Instructions 
  4081.  i386-Float                              Floating Point 
  4082.  i386-Notes                              Notes 
  4083.  
  4084.  
  4085. ΓòÉΓòÉΓòÉ 20.1. Options ΓòÉΓòÉΓòÉ
  4086.  
  4087. The 80386 has no machine dependent options. 
  4088.  
  4089.  
  4090. ΓòÉΓòÉΓòÉ 20.2. AT&T Syntax versus Intel Syntax ΓòÉΓòÉΓòÉ
  4091.  
  4092. In order to maintain compatibility with the output of gcc, as supports AT&T 
  4093. System V/386 assembler syntax.  This is quite different from Intel syntax.  We 
  4094. mention these differences because almost all 80386 documents used only Intel 
  4095. syntax.  Notable differences between the two syntaxes are: 
  4096.  
  4097.      AT&T immediate operands are preceded by `$'; Intel immediate operands are 
  4098.       undelimited (Intel `push 4' is AT&T `pushl $4'). AT&T register operands 
  4099.       are preceded by `%'; Intel register operands are undelimited.  AT&T 
  4100.       absolute (as opposed to PC relative) jump/call operands are prefixed by 
  4101.       `*'; they are undelimited in Intel syntax. 
  4102.  
  4103.      AT&T and Intel syntax use the opposite order for source and destination 
  4104.       operands.  Intel `add eax, 4' is `addl $4, %eax'.  The `source, dest' 
  4105.       convention is maintained for compatibility with previous Unix assemblers. 
  4106.  
  4107.      In AT&T syntax the size of memory operands is determined from the last 
  4108.       character of the opcode name.  Opcode suffixes of `b', `w', and `l' 
  4109.       specify byte (8-bit), word (16-bit), and long (32-bit) memory references. 
  4110.       Intel syntax accomplishes this by prefixes memory operands (not the 
  4111.       opcodes themselves) with `byte ptr', `word ptr', and `dword ptr'.  Thus, 
  4112.       Intel `mov al, byte ptr foo' is `movb foo, %al' in AT&T syntax. 
  4113.  
  4114.      Immediate form long jumps and calls are `lcall/ljmp $section, $offset' in 
  4115.       AT&T syntax; the Intel syntax is `call/jmp far section:offset'.  Also, 
  4116.       the far return instruction is `lret $stack-adjust' in AT&T syntax; Intel 
  4117.       syntax is `ret far stack-adjust'. 
  4118.  
  4119.      The AT&T assembler does not provide support for multiple section 
  4120.       programs.  Unix style systems expect all programs to be single sections. 
  4121.  
  4122.  
  4123. ΓòÉΓòÉΓòÉ 20.3. Opcode Naming ΓòÉΓòÉΓòÉ
  4124.  
  4125. Opcode names are suffixed with one character modifiers which specify the size 
  4126. of operands.  The letters `b', `w', and `l' specify byte, word, and long 
  4127. operands.  If no suffix is specified by an instruction and it contains no 
  4128. memory operands then as tries to fill in the missing suffix based on the 
  4129. destination register operand (the last one by convention).  Thus, `mov %ax, 
  4130. %bx' is equivalent to `movw %ax, %bx'; also, `mov $1, %bx' is equivalent to 
  4131. `movw $1, %bx'.  Note that this is incompatible with the AT&T Unix assembler 
  4132. which assumes that a missing opcode suffix implies long operand size.  (This 
  4133. incompatibility does not affect compiler output since compilers always 
  4134. explicitly specify the opcode suffix.) 
  4135.  
  4136. Almost all opcodes have the same names in AT&T and Intel format.  There are a 
  4137. few exceptions.  The sign extend and zero extend instructions need two sizes to 
  4138. specify them.  They need a size to sign/zero extend from and a size to zero 
  4139. extend to.  This is accomplished by using two opcode suffixes in AT&T syntax. 
  4140. Base names for sign extend and zero extend are `movs...' and `movz...' in AT&T 
  4141. syntax (`movsx' and `movzx' in Intel syntax).  The opcode suffixes are tacked 
  4142. on to this base name, the from suffix before the to suffix.  Thus, `movsbl %al, 
  4143. %edx' is AT&T syntax for ``move sign extend from %al to %edx.''  Possible 
  4144. suffixes, thus, are `bl' (from byte to long), `bw' (from byte to word), and 
  4145. `wl' (from word to long). 
  4146.  
  4147. The Intel-syntax conversion instructions 
  4148.  
  4149.      `cbw' --- sign-extend byte in `%al' to word in `%ax', 
  4150.  
  4151.      `cwde' --- sign-extend word in `%ax' to long in `%eax', 
  4152.  
  4153.      `cwd' --- sign-extend word in `%ax' to long in `%dx:%ax', 
  4154.  
  4155.      `cdq' --- sign-extend dword in `%eax' to quad in `%edx:%eax', 
  4156.  
  4157.  are called `cbtw', `cwtl', `cwtd', and `cltd' in AT&T naming.  as accepts 
  4158.  either naming for these instructions. 
  4159.  
  4160.  Far call/jump instructions are `lcall' and `ljmp' in AT&T syntax, but are 
  4161.  `call far' and `jump far' in Intel convention. 
  4162.  
  4163.  
  4164. ΓòÉΓòÉΓòÉ 20.4. Register Naming ΓòÉΓòÉΓòÉ
  4165.  
  4166. Register operands are always prefixes with `%'.  The 80386 registers consist of 
  4167.  
  4168.      the 8 32-bit registers `%eax' (the accumulator), `%ebx', `%ecx', `%edx', 
  4169.       `%edi', `%esi', `%ebp' (the frame pointer), and `%esp' (the stack 
  4170.       pointer). 
  4171.  
  4172.      the 8 16-bit low-ends of these: `%ax', `%bx', `%cx', `%dx', `%di', `%si', 
  4173.       `%bp', and `%sp'. 
  4174.  
  4175.      the 8 8-bit registers: `%ah', `%al', `%bh', `%bl', `%ch', `%cl', `%dh', 
  4176.       and `%dl' (These are the high-bytes and low-bytes of `%ax', `%bx', `%cx', 
  4177.       and `%dx') 
  4178.  
  4179.      the 6 section registers `%cs' (code section), `%ds' (data section), `%ss' 
  4180.       (stack section), `%es', `%fs', and `%gs'. 
  4181.  
  4182.      the 3 processor control registers `%cr0', `%cr2', and `%cr3'. 
  4183.  
  4184.      the 6 debug registers `%db0', `%db1', `%db2', `%db3', `%db6', and `%db7'. 
  4185.  
  4186.      the 2 test registers `%tr6' and `%tr7'. 
  4187.  
  4188.      the 8 floating point register stack `%st' or equivalently `%st(0)', 
  4189.       `%st(1)', `%st(2)', `%st(3)', `%st(4)', `%st(5)', `%st(6)', and `%st(7)'. 
  4190.  
  4191.  
  4192. ΓòÉΓòÉΓòÉ 20.5. Opcode Prefixes ΓòÉΓòÉΓòÉ
  4193.  
  4194. Opcode prefixes are used to modify the following opcode.  They are used to 
  4195. repeat string instructions, to provide section overrides, to perform bus lock 
  4196. operations, and to give operand and address size (16-bit operands are specified 
  4197. in an instruction by prefixing what would normally be 32-bit operands with a 
  4198. ``operand size'' opcode prefix). Opcode prefixes are usually given as 
  4199. single-line instructions with no operands, and must directly precede the 
  4200. instruction they act upon.  For example, the `scas' (scan string) instruction 
  4201. is repeated with: 
  4202.  
  4203.         repne
  4204.         scas
  4205.  
  4206. Here is a list of opcode prefixes: 
  4207.  
  4208.      Section override prefixes `cs', `ds', `ss', `es', `fs', `gs'.  These are 
  4209.       automatically added by specifying using the section:memory-operand form 
  4210.       for memory references. 
  4211.  
  4212.      Operand/Address size prefixes `data16' and `addr16' change 32-bit 
  4213.       operands/addresses into 16-bit operands/addresses.  Note that 16-bit 
  4214.       addressing modes (i.e. 8086 and 80286 addressing modes) are not supported 
  4215.       (yet). 
  4216.  
  4217.      The bus lock prefix `lock' inhibits interrupts during execution of the 
  4218.       instruction it precedes.  (This is only valid with certain instructions; 
  4219.       see a 80386 manual for details). 
  4220.  
  4221.      The wait for coprocessor prefix `wait' waits for the coprocessor to 
  4222.       complete the current instruction.  This should never be needed for the 
  4223.       80386/80387 combination. 
  4224.  
  4225.      The `rep', `repe', and `repne' prefixes are added to string instructions 
  4226.       to make them repeat `%ecx' times. 
  4227.  
  4228.  
  4229. ΓòÉΓòÉΓòÉ 20.6. Memory References ΓòÉΓòÉΓòÉ
  4230.  
  4231. An Intel syntax indirect memory reference of the form 
  4232.  
  4233. section:[base + index*scale + disp]
  4234.  
  4235. is translated into the AT&T syntax 
  4236.  
  4237. section:disp(base, index, scale)
  4238.  
  4239. where base and index are the optional 32-bit base and index registers, disp is 
  4240. the optional displacement, and scale, taking the values 1, 2, 4, and 8, 
  4241. multiplies index to calculate the address of the operand.  If no scale is 
  4242. specified, scale is taken to be 1.  section specifies the optional section 
  4243. register for the memory operand, and may override the default section register 
  4244. (see a 80386 manual for section register defaults). Note that section overrides 
  4245. in AT&T syntax must have be preceded by a `%'.  If you specify a section 
  4246. override which coincides with the default section register, as does not output 
  4247. any section register override prefixes to assemble the given instruction. 
  4248. Thus, section overrides can be specified to emphasize which section register is 
  4249. used for a given memory operand. 
  4250.  
  4251. Here are some examples of Intel and AT&T style memory references: 
  4252.  
  4253.  AT&T: `-4(%ebp)', Intel:  `[ebp - 4]' 
  4254.            base is `%ebp'; disp is `-4'. section is missing, and the default 
  4255.            section is used (`%ss' for addressing with `%ebp' as the base 
  4256.            register).  index, scale are both missing. 
  4257.  
  4258.  AT&T: `foo(,%eax,4)', Intel: `[foo + eax*4]' 
  4259.            index is `%eax' (scaled by a scale 4); disp is `foo'.  All other 
  4260.            fields are missing.  The section register here defaults to `%ds'. 
  4261.  
  4262.  AT&T: `foo(,1)'; Intel `[foo]' 
  4263.            This uses the value pointed to by `foo' as a memory operand. Note 
  4264.            that base and index are both missing, but there is only one `,'. 
  4265.            This is a syntactic exception. 
  4266.  
  4267.  AT&T: `%gs:foo'; Intel `gs:foo' 
  4268.            This selects the contents of the variable `foo' with section 
  4269.            register section being `%gs'. 
  4270.  
  4271.  Absolute (as opposed to PC relative) call and jump operands must be prefixed 
  4272.  with `*'.  If no `*' is specified, as always chooses PC relative addressing 
  4273.  for jump/call labels. 
  4274.  
  4275.  Any instruction that has a memory operand must specify its size (byte, word, 
  4276.  or long) with an opcode suffix (`b', `w', or `l', respectively). 
  4277.  
  4278.  
  4279. ΓòÉΓòÉΓòÉ 20.7. Handling of Jump Instructions ΓòÉΓòÉΓòÉ
  4280.  
  4281. Jump instructions are always optimized to use the smallest possible 
  4282. displacements.  This is accomplished by using byte (8-bit) displacement jumps 
  4283. whenever the target is sufficiently close.  If a byte displacement is 
  4284. insufficient a long (32-bit) displacement is used.  We do not support word 
  4285. (16-bit) displacement jumps (i.e. prefixing the jump instruction with the 
  4286. `addr16' opcode prefix), since the 80386 insists upon masking `%eip' to 16 bits 
  4287. after the word displacement is added. 
  4288.  
  4289. Note that the `jcxz', `jecxz', `loop', `loopz', `loope', `loopnz' and `loopne' 
  4290. instructions only come in byte displacements, so that if you use these 
  4291. instructions (gcc does not use them) you may get an error message (and 
  4292. incorrect code).  The AT&T 80386 assembler tries to get around this problem by 
  4293. expanding `jcxz foo' to 
  4294.  
  4295.          jcxz cx_zero
  4296.          jmp cx_nonzero
  4297. cx_zero: jmp foo
  4298. cx_nonzero:
  4299.  
  4300.  
  4301. ΓòÉΓòÉΓòÉ 20.8. Floating Point ΓòÉΓòÉΓòÉ
  4302.  
  4303. All 80387 floating point types except packed BCD are supported. (BCD support 
  4304. may be added without much difficulty).  These data types are 16-, 32-, and 64- 
  4305. bit integers, and single (32-bit), double (64-bit), and extended (80-bit) 
  4306. precision floating point. Each supported type has an opcode suffix and a 
  4307. constructor associated with it.  Opcode suffixes specify operand's data types. 
  4308. Constructors build these data types into memory. 
  4309.  
  4310.      Floating point constructors are `.float' or `.single', `.double', and 
  4311.       `.tfloat' for 32-, 64-, and 80-bit formats. These correspond to opcode 
  4312.       suffixes `s', `l', and `t'. `t' stands for temporary real, and that the 
  4313.       80387 only supports this format via the `fldt' (load temporary real to 
  4314.       stack top) and `fstpt' (store temporary real and pop stack) instructions. 
  4315.  
  4316.      Integer constructors are `.word', `.long' or `.int', and `.quad' for the 
  4317.       16-, 32-, and 64-bit integer formats.  The corresponding opcode suffixes 
  4318.       are `s' (single), `l' (long), and `q' (quad).  As with the temporary real 
  4319.       format the 64-bit `q' format is only present in the `fildq' (load quad 
  4320.       integer to stack top) and `fistpq' (store quad integer and pop stack) 
  4321.       instructions. 
  4322.  
  4323.  Register to register operations do not require opcode suffixes, so that `fst 
  4324.  %st, %st(1)' is equivalent to `fstl %st, %st(1)'. 
  4325.  
  4326.  Since the 80387 automatically synchronizes with the 80386 `fwait' instructions 
  4327.  are almost never needed (this is not the case for the 80286/80287 and 
  4328.  8086/8087 combinations).  Therefore, as suppresses the `fwait' instruction 
  4329.  whenever it is implicitly selected by one of the `fn...' instructions.  For 
  4330.  example, `fsave' and `fnsave' are treated identically.  In general, all the 
  4331.  `fn...' instructions are made equivalent to `f...' instructions.  If `fwait' 
  4332.  is desired it must be explicitly coded. 
  4333.  
  4334.  
  4335. ΓòÉΓòÉΓòÉ 20.9. Notes ΓòÉΓòÉΓòÉ
  4336.  
  4337. There is some trickery concerning the `mul' and `imul' instructions that 
  4338. deserves mention.  The 16-, 32-, and 64-bit expanding multiplies (base opcode 
  4339. `0xf6'; extension 4 for `mul' and 5 for `imul') can be output only in the one 
  4340. operand form.  Thus, `imul %ebx, %eax' does not select the expanding multiply; 
  4341. the expanding multiply would clobber the `%edx' register, and this would 
  4342. confuse gcc output.  Use `imul %ebx' to get the 64-bit product in `%edx:%eax'. 
  4343.  
  4344. We have added a two operand form of `imul' when the first operand is an 
  4345. immediate mode expression and the second operand is a register. This is just a 
  4346. shorthand, so that, multiplying `%eax' by 69, for example, can be done with 
  4347. `imul $69, %eax' rather than `imul $69, %eax, %eax'. 
  4348.  
  4349.  
  4350. ΓòÉΓòÉΓòÉ 21. Z8000 Dependent Features ΓòÉΓòÉΓòÉ
  4351.  
  4352. The Z8000 as supports both members of the Z8000 family: the unsegmented Z8002, 
  4353. with 16 bit addresses, and the segmented Z8001 with 24 bit addresses. 
  4354.  
  4355. When the assembler is in unsegmented mode (specified with the unsegm 
  4356. directive), an address takes up one word (16 bit) sized register.  When the 
  4357. assembler is in segmented mode (specified with the segm directive), a 24-bit 
  4358. address takes up a long (32 bit) register.  See Assembler Directives for the 
  4359. Z8000, for a list of other Z8000 specific assembler directives. 
  4360.  
  4361.  Z8000 Options                           No special command-line options for 
  4362.                                          Z8000 
  4363.  Z8000 Syntax                            Assembler syntax for the Z8000 
  4364.  Z8000 Directives                        Special directives for the Z8000 
  4365.  Z8000 Opcodes                           Opcodes 
  4366.  
  4367.  
  4368. ΓòÉΓòÉΓòÉ 21.1. Options ΓòÉΓòÉΓòÉ
  4369.  
  4370. as has no additional command-line options for the Zilog Z8000 family. 
  4371.  
  4372.  
  4373. ΓòÉΓòÉΓòÉ 21.2. Syntax ΓòÉΓòÉΓòÉ
  4374.  
  4375.  Z8000-Chars                             Special Characters 
  4376.  Z8000-Regs                              Register Names 
  4377.  Z8000-Addressing                        Addressing Modes 
  4378.  
  4379.  
  4380. ΓòÉΓòÉΓòÉ 21.2.1. Special Characters ΓòÉΓòÉΓòÉ
  4381.  
  4382. `!' is the line comment character. 
  4383.  
  4384. You can use `;' instead of a newline to separate statements. 
  4385.  
  4386.  
  4387. ΓòÉΓòÉΓòÉ 21.2.2. Register Names ΓòÉΓòÉΓòÉ
  4388.  
  4389. The Z8000 has sixteen 16 bit registers, numbered 0 to 15.  You can refer to 
  4390. different sized groups of registers by register number, with the prefix `r' for 
  4391. 16 bit registers, `rr' for 32 bit registers and `rq' for 64 bit registers.  You 
  4392. can also refer to the contents of the first eight (of the sixteen 16 bit 
  4393. registers) by bytes.  They are named `rnh' and `rnl'. 
  4394.  
  4395. byte registers
  4396. r0l r0h r1h r1l r2h r2l r3h r3l
  4397. r4h r4l r5h r5l r6h r6l r7h r7l
  4398.  
  4399. word registers
  4400. r0 r1 r2 r3 r4 r5 r6 r7 r8 r9 r10 r11 r12 r13 r14 r15
  4401.  
  4402. long word registers
  4403. rr0 rr2 rr4 rr6 rr8 rr10 rr12 rr14
  4404.  
  4405. quad word registers
  4406. rq0 rq4 rq8 rq12
  4407.  
  4408.  
  4409. ΓòÉΓòÉΓòÉ 21.2.3. Addressing Modes ΓòÉΓòÉΓòÉ
  4410.  
  4411. as understands the following addressing modes for the Z8000: 
  4412.  
  4413.  rn 
  4414.            Register direct 
  4415.  
  4416.  @rn 
  4417.            Indirect register 
  4418.  
  4419.  addr 
  4420.            Direct: the 16 bit or 24 bit address (depending on whether the 
  4421.            assembler is in segmented or unsegmented mode) of the operand is in 
  4422.            the instruction. 
  4423.  
  4424.  address(rn) 
  4425.            Indexed: the 16 or 24 bit address is added to the 16 bit register to 
  4426.            produce the final address in memory of the operand. 
  4427.  
  4428.  rn(#imm) 
  4429.            Base Address: the 16 or 24 bit register is added to the 16 bit sign 
  4430.            extended immediate displacement to produce the final address in 
  4431.            memory of the operand. 
  4432.  
  4433.  rn(rm) 
  4434.            Base Index: the 16 or 24 bit register rn is added to the sign 
  4435.            extended 16 bit index register rm to produce the final address in 
  4436.            memory of the operand. 
  4437.  
  4438.  #xx 
  4439.            Immediate data xx. 
  4440.  
  4441.  
  4442. ΓòÉΓòÉΓòÉ 21.3. Assembler Directives for the Z8000 ΓòÉΓòÉΓòÉ
  4443.  
  4444. The Z8000 port of as includes these additional assembler directives, for 
  4445. compatibility with other Z8000 assemblers.  As shown, these do not begin with 
  4446. `.' (unlike the ordinary as directives). 
  4447.  
  4448.  segm 
  4449.            Generates code for the segmented Z8001. 
  4450.  
  4451.  unsegm 
  4452.            Generates code for the unsegmented Z8002. 
  4453.  
  4454.  name 
  4455.            Synonym for .file 
  4456.  
  4457.  global 
  4458.            Synonum for .global 
  4459.  
  4460.  wval 
  4461.            Synonym for .word 
  4462.  
  4463.  lval 
  4464.            Synonym for .long 
  4465.  
  4466.  bval 
  4467.            Synonym for .byte 
  4468.  
  4469.  sval 
  4470.            Assemble a string.  sval expects one string literal, delimited by 
  4471.            single quotes.  It assembles each byte of the string into 
  4472.            consecutive addresses.  You can use the escape sequence `%xx' (where 
  4473.            xx represents a two-digit hexadecimal number) to represent the 
  4474.            character whose ascii value is xx.  Use this feature to describe 
  4475.            single quote and other characters that may not appear in string 
  4476.            literals as themselves.  For example, the C statement `char *a = "he 
  4477.            said \"it's 50% off\"";' is represented in Z8000 assembly language 
  4478.            (shown with the assembler output in hex at the left) as 
  4479.  
  4480.                       68652073    sval    'he said %22it%27s 50%25 off%22%00'
  4481.                       61696420
  4482.                       22697427
  4483.                       73203530
  4484.                       25206F66
  4485.                       662200
  4486.  
  4487.  rsect 
  4488.            synonym for .section 
  4489.  
  4490.  block 
  4491.            synonym for .space 
  4492.  
  4493.  even 
  4494.            synonym for .align 1 
  4495.  
  4496.  
  4497. ΓòÉΓòÉΓòÉ 21.4. Opcodes ΓòÉΓòÉΓòÉ
  4498.  
  4499. For detailed information on the Z8000 machine instruction set, see Z8000 
  4500. Technical Manual. 
  4501.  
  4502. The following table summarizes the opcodes and their arguments: 
  4503.  
  4504.  
  4505.             rs   16 bit source register
  4506.             rd   16 bit destination register
  4507.             rbs   8 bit source register
  4508.             rbd   8 bit destination register
  4509.             rrs   32 bit source register
  4510.             rrd   32 bit destination register
  4511.             rqs   64 bit source register
  4512.             rqd   64 bit destination register
  4513.             addr 16/24 bit address
  4514.             imm  immediate data
  4515.  
  4516. adc rd,rs               clrb addr               cpsir @rd,@rs,rr,cc
  4517. adcb rbd,rbs            clrb addr(rd)           cpsirb @rd,@rs,rr,cc
  4518. add rd,@rs              clrb rbd                dab rbd
  4519. add rd,addr             com @rd                 dbjnz rbd,disp7
  4520. add rd,addr(rs)         com addr                dec @rd,imm4m1
  4521. add rd,imm16            com addr(rd)            dec addr(rd),imm4m1
  4522. add rd,rs               com rd                  dec addr,imm4m1
  4523. addb rbd,@rs            comb @rd                dec rd,imm4m1
  4524. addb rbd,addr           comb addr               decb @rd,imm4m1
  4525. addb rbd,addr(rs)       comb addr(rd)           decb addr(rd),imm4m1
  4526. addb rbd,imm8           comb rbd                decb addr,imm4m1
  4527. addb rbd,rbs            comflg flags            decb rbd,imm4m1
  4528. addl rrd,@rs            cp @rd,imm16            di i2
  4529. addl rrd,addr           cp addr(rd),imm16       div rrd,@rs
  4530. addl rrd,addr(rs)       cp addr,imm16           div rrd,addr
  4531. addl rrd,imm32          cp rd,@rs               div rrd,addr(rs)
  4532. addl rrd,rrs            cp rd,addr              div rrd,imm16
  4533. and rd,@rs              cp rd,addr(rs)          div rrd,rs
  4534. and rd,addr             cp rd,imm16             divl rqd,@rs
  4535. and rd,addr(rs)         cp rd,rs                divl rqd,addr
  4536. and rd,imm16            cpb @rd,imm8            divl rqd,addr(rs)
  4537. and rd,rs               cpb addr(rd),imm8       divl rqd,imm32
  4538. andb rbd,@rs            cpb addr,imm8           divl rqd,rrs
  4539. andb rbd,addr           cpb rbd,@rs             djnz rd,disp7
  4540. andb rbd,addr(rs)       cpb rbd,addr            ei i2
  4541. andb rbd,imm8           cpb rbd,addr(rs)        ex rd,@rs
  4542. andb rbd,rbs            cpb rbd,imm8            ex rd,addr
  4543. bit @rd,imm4            cpb rbd,rbs             ex rd,addr(rs)
  4544. bit addr(rd),imm4       cpd rd,@rs,rr,cc        ex rd,rs
  4545. bit addr,imm4           cpdb rbd,@rs,rr,cc      exb rbd,@rs
  4546. bit rd,imm4             cpdr rd,@rs,rr,cc       exb rbd,addr
  4547. bit rd,rs               cpdrb rbd,@rs,rr,cc     exb rbd,addr(rs)
  4548. bitb @rd,imm4           cpi rd,@rs,rr,cc        exb rbd,rbs
  4549. bitb addr(rd),imm4      cpib rbd,@rs,rr,cc      ext0e imm8
  4550. bitb addr,imm4          cpir rd,@rs,rr,cc       ext0f imm8
  4551. bitb rbd,imm4           cpirb rbd,@rs,rr,cc     ext8e imm8
  4552. bitb rbd,rs             cpl rrd,@rs             ext8f imm8
  4553. bpt                     cpl rrd,addr            exts rrd
  4554. call @rd                cpl rrd,addr(rs)        extsb rd
  4555. call addr               cpl rrd,imm32           extsl rqd
  4556. call addr(rd)           cpl rrd,rrs             halt
  4557. calr disp12             cpsd @rd,@rs,rr,cc      in rd,@rs
  4558. clr @rd                 cpsdb @rd,@rs,rr,cc     in rd,imm16
  4559. clr addr                cpsdr @rd,@rs,rr,cc     inb rbd,@rs
  4560. clr addr(rd)            cpsdrb @rd,@rs,rr,cc    inb rbd,imm16
  4561. clr rd                  cpsi @rd,@rs,rr,cc      inc @rd,imm4m1
  4562. clrb @rd                cpsib @rd,@rs,rr,cc     inc addr(rd),imm4m1
  4563. inc addr,imm4m1         ldb rbd,rs(rx)          mult rrd,addr(rs)
  4564. inc rd,imm4m1           ldb rd(imm16),rbs       mult rrd,imm16
  4565. incb @rd,imm4m1         ldb rd(rx),rbs          mult rrd,rs
  4566. incb addr(rd),imm4m1    ldctl ctrl,rs           multl rqd,@rs
  4567. incb addr,imm4m1        ldctl rd,ctrl           multl rqd,addr
  4568. incb rbd,imm4m1         ldd @rs,@rd,rr          multl rqd,addr(rs)
  4569. ind @rd,@rs,ra          lddb @rs,@rd,rr         multl rqd,imm32
  4570. indb @rd,@rs,rba        lddr @rs,@rd,rr         multl rqd,rrs
  4571. inib @rd,@rs,ra         lddrb @rs,@rd,rr        neg @rd
  4572. inibr @rd,@rs,ra        ldi @rd,@rs,rr          neg addr
  4573. iret                    ldib @rd,@rs,rr         neg addr(rd)
  4574. jp cc,@rd               ldir @rd,@rs,rr         neg rd
  4575. jp cc,addr              ldirb @rd,@rs,rr        negb @rd
  4576. jp cc,addr(rd)          ldk rd,imm4             negb addr
  4577. jr cc,disp8             ldl @rd,rrs             negb addr(rd)
  4578. ld @rd,imm16            ldl addr(rd),rrs        negb rbd
  4579. ld @rd,rs               ldl addr,rrs            nop
  4580. ld addr(rd),imm16       ldl rd(imm16),rrs       or rd,@rs
  4581. ld addr(rd),rs          ldl rd(rx),rrs          or rd,addr
  4582. ld addr,imm16           ldl rrd,@rs             or rd,addr(rs)
  4583. ld addr,rs              ldl rrd,addr            or rd,imm16
  4584. ld rd(imm16),rs         ldl rrd,addr(rs)        or rd,rs
  4585. ld rd(rx),rs            ldl rrd,imm32           orb rbd,@rs
  4586. ld rd,@rs               ldl rrd,rrs             orb rbd,addr
  4587. ld rd,addr              ldl rrd,rs(imm16)       orb rbd,addr(rs)
  4588. ld rd,addr(rs)          ldl rrd,rs(rx)          orb rbd,imm8
  4589. ld rd,imm16             ldm @rd,rs,n            orb rbd,rbs
  4590. ld rd,rs                ldm addr(rd),rs,n       out @rd,rs
  4591. ld rd,rs(imm16)         ldm addr,rs,n           out imm16,rs
  4592. ld rd,rs(rx)            ldm rd,@rs,n            outb @rd,rbs
  4593. lda rd,addr             ldm rd,addr(rs),n       outb imm16,rbs
  4594. lda rd,addr(rs)         ldm rd,addr,n           outd @rd,@rs,ra
  4595. lda rd,rs(imm16)        ldps @rs                outdb @rd,@rs,rba
  4596. lda rd,rs(rx)           ldps addr               outib @rd,@rs,ra
  4597. ldar rd,disp16          ldps addr(rs)           outibr @rd,@rs,ra
  4598. ldb @rd,imm8            ldr disp16,rs           pop @rd,@rs
  4599. ldb @rd,rbs             ldr rd,disp16           pop addr(rd),@rs
  4600. ldb addr(rd),imm8       ldrb disp16,rbs         pop addr,@rs
  4601. ldb addr(rd),rbs        ldrb rbd,disp16         pop rd,@rs
  4602. ldb addr,imm8           ldrl disp16,rrs         popl @rd,@rs
  4603. ldb addr,rbs            ldrl rrd,disp16         popl addr(rd),@rs
  4604. ldb rbd,@rs             mbit                    popl addr,@rs
  4605. ldb rbd,addr            mreq rd                 popl rrd,@rs
  4606. ldb rbd,addr(rs)        mres                    push @rd,@rs
  4607. ldb rbd,imm8            mset                    push @rd,addr
  4608. ldb rbd,rbs             mult rrd,@rs            push @rd,addr(rs)
  4609. ldb rbd,rs(imm16)       mult rrd,addr           push @rd,imm16
  4610. push @rd,rs             set addr,imm4           subl rrd,imm32
  4611. pushl @rd,@rs           set rd,imm4             subl rrd,rrs
  4612. pushl @rd,addr          set rd,rs               tcc cc,rd
  4613. pushl @rd,addr(rs)      setb @rd,imm4           tccb cc,rbd
  4614. pushl @rd,rrs           setb addr(rd),imm4      test @rd
  4615. res @rd,imm4            setb addr,imm4          test addr
  4616. res addr(rd),imm4       setb rbd,imm4           test addr(rd)
  4617. res addr,imm4           setb rbd,rs             test rd
  4618. res rd,imm4             setflg imm4             testb @rd
  4619. res rd,rs               sinb rbd,imm16          testb addr
  4620. resb @rd,imm4           sinb rd,imm16           testb addr(rd)
  4621. resb addr(rd),imm4      sind @rd,@rs,ra         testb rbd
  4622. resb addr,imm4          sindb @rd,@rs,rba       testl @rd
  4623. resb rbd,imm4           sinib @rd,@rs,ra        testl addr
  4624. resb rbd,rs             sinibr @rd,@rs,ra       testl addr(rd)
  4625. resflg imm4             sla rd,imm8             testl rrd
  4626. ret cc                  slab rbd,imm8           trdb @rd,@rs,rba
  4627. rl rd,imm1or2           slal rrd,imm8           trdrb @rd,@rs,rba
  4628. rlb rbd,imm1or2         sll rd,imm8             trib @rd,@rs,rbr
  4629. rlc rd,imm1or2          sllb rbd,imm8           trirb @rd,@rs,rbr
  4630. rlcb rbd,imm1or2        slll rrd,imm8           trtdrb @ra,@rb,rbr
  4631. rldb rbb,rba            sout imm16,rs           trtib @ra,@rb,rr
  4632. rr rd,imm1or2           soutb imm16,rbs         trtirb @ra,@rb,rbr
  4633. rrb rbd,imm1or2         soutd @rd,@rs,ra        trtrb @ra,@rb,rbr
  4634. rrc rd,imm1or2          soutdb @rd,@rs,rba      tset @rd
  4635. rrcb rbd,imm1or2        soutib @rd,@rs,ra       tset addr
  4636. rrdb rbb,rba            soutibr @rd,@rs,ra      tset addr(rd)
  4637. rsvd36                  sra rd,imm8             tset rd
  4638. rsvd38                  srab rbd,imm8           tsetb @rd
  4639. rsvd78                  sral rrd,imm8           tsetb addr
  4640. rsvd7e                  srl rd,imm8             tsetb addr(rd)
  4641. rsvd9d                  srlb rbd,imm8           tsetb rbd
  4642. rsvd9f                  srll rrd,imm8           xor rd,@rs
  4643. rsvdb9                  sub rd,@rs              xor rd,addr
  4644. rsvdbf                  sub rd,addr             xor rd,addr(rs)
  4645. sbc rd,rs               sub rd,addr(rs)         xor rd,imm16
  4646. sbcb rbd,rbs            sub rd,imm16            xor rd,rs
  4647. sc imm8                 sub rd,rs               xorb rbd,@rs
  4648. sda rd,rs               subb rbd,@rs            xorb rbd,addr
  4649. sdab rbd,rs             subb rbd,addr           xorb rbd,addr(rs)
  4650. sdal rrd,rs             subb rbd,addr(rs)       xorb rbd,imm8
  4651. sdl rd,rs               subb rbd,imm8           xorb rbd,rbs
  4652. sdlb rbd,rs             subb rbd,rbs            xorb rbd,rbs
  4653. sdll rrd,rs             subl rrd,@rs
  4654. set @rd,imm4            subl rrd,addr
  4655. set addr(rd),imm4       subl rrd,addr(rs)
  4656.  
  4657.  
  4658. ΓòÉΓòÉΓòÉ 22. MIPS Dependent Features ΓòÉΓòÉΓòÉ
  4659.  
  4660. gnu as for mips architectures supports the mips r2000, r3000, r4000 and r6000 
  4661. processors.  For information about the mips instruction set, see MIPS RISC 
  4662. Architecture, by Kane and Heindrich (Prentice-Hall).  For an overview of mips 
  4663. assembly conventions, see ``Appendix D: Assembly Language Programming'' in the 
  4664. same work. 
  4665.  
  4666.  MIPS Opts                               Assembler options 
  4667.  MIPS Object                             ECOFF object code 
  4668.  MIPS Stabs                              Directives for debugging information 
  4669.  MIPS ISA                                Directives to override the ISA level 
  4670.  
  4671.  
  4672. ΓòÉΓòÉΓòÉ 22.1. Assembler options ΓòÉΓòÉΓòÉ
  4673.  
  4674. The mips configurations of gnu as support these special options: 
  4675.  
  4676.  -G num 
  4677.            This option sets the largest size of an object that can be 
  4678.            referenced implicitly with the gp register.  It is only accepted for 
  4679.            targets that use ecoff format.  The default value is 8. 
  4680.  
  4681.  -EB 
  4682.  -EL 
  4683.            Any mips configuration of as can select big-endian or little-endian 
  4684.            output at run time (unlike the other gnu development tools, which 
  4685.            must be configured for one or the other).  Use `-EB' to select 
  4686.            big-endian output, and `-EL' for little-endian. 
  4687.  
  4688.  -mips1 
  4689.  -mips2 
  4690.  -mips3 
  4691.            Generate code for a particular MIPS Instruction Set Architecture 
  4692.            level. `-mips1' corresponds to the r2000 and r3000 processors, 
  4693.            `-mips2' to the r6000 processor, and `-mips3' to the r4000 
  4694.            processor.  You can also switch instruction sets during the 
  4695.            assembly; see Directives to override the ISA level. 
  4696.  
  4697.  -nocpp 
  4698.            This option is ignored.  It is accepted for command-line 
  4699.            compatibility with other assemblers, which use it to turn off C 
  4700.            style preprocessing.  With gnu as, there is no need for `-nocpp', 
  4701.            because the gnu assembler itself never runs the C preprocessor. 
  4702.  
  4703.  --trap 
  4704.  --no-break 
  4705.            as automatically macro expands certain division and multiplication 
  4706.            instructions to check for overflow and division by zero.  This 
  4707.            option causes as to generate code to take a trap exception rather 
  4708.            than a break exception when an error is detected.  The trap 
  4709.            instructions are only supported at Instruction Set Architecture 
  4710.            level 2 and higher. 
  4711.  
  4712.  --break 
  4713.  --no-trap 
  4714.            Generate code to take a break exception rather than a trap exception 
  4715.            when an error is detected.  This is the default. 
  4716.  
  4717.  
  4718. ΓòÉΓòÉΓòÉ 22.2. MIPS ECOFF object code ΓòÉΓòÉΓòÉ
  4719.  
  4720. Assembling for a mips ecoff target supports some additional sections besides 
  4721. the usual .text, .data and .bss.  The additional sections are .rdata, used for 
  4722. read-only data, .sdata, used for small data, and .sbss, used for small common 
  4723. objects. 
  4724.  
  4725. When assembling for ecoff, the assembler uses the $gp ($28) register to form 
  4726. the address of a ``small object''.  Any object in the .sdata or .sbss sections 
  4727. is considered ``small'' in this sense. For external objects, or for objects in 
  4728. the .bss section, you can use the gcc `-G' option to control the size of 
  4729. objects addressed via $gp; the default value is 8, meaning that a reference to 
  4730. any object eight bytes or smaller uses $gp.  Passing `-G 0' to as prevents it 
  4731. from using the $gp register on the basis of object size (but the assembler uses 
  4732. $gp for objects in .sdata or sbss in any case).  The size of an object in the 
  4733. .bss section is set by the .comm or .lcomm directive that defines it.  The size 
  4734. of an external object may be set with the .extern directive.  For example, 
  4735. `.extern sym,4' declares that the object at sym is 4 bytes in length, whie 
  4736. leaving sym otherwise undefined. 
  4737.  
  4738. Using small ecoff objects requires linker support, and assumes that the $gp 
  4739. register is correctly initialized (normally done automatically by the startup 
  4740. code).  mips ecoff assembly code must not modify the $gp register. 
  4741.  
  4742.  
  4743. ΓòÉΓòÉΓòÉ 22.3. Directives for debugging information ΓòÉΓòÉΓòÉ
  4744.  
  4745. mips ecoff as supports several directives used for generating debugging 
  4746. information which are not support by traditional mips assemblers.  These are 
  4747. .def, .endef, .dim, .file, .scl, .size, .tag, .type, .val, .stabd, .stabn, and 
  4748. .stabs.  The debugging information generated by the three .stab directives can 
  4749. only be read by gdb, not by traditional mips debuggers (this enhancement is 
  4750. required to fully support C++ debugging).  These directives are primarily used 
  4751. by compilers, not assembly language programmers! 
  4752.  
  4753.  
  4754. ΓòÉΓòÉΓòÉ 22.4. Directives to override the ISA level ΓòÉΓòÉΓòÉ
  4755.  
  4756. gnu as supports an additional directive to change the mips Instruction Set 
  4757. Architecture level on the fly: .set mipsn.  n should be a number from 0 to 3. 
  4758. A value from 1 to 3 makes the assembler accept instructions for the 
  4759. corresponding isa level, from that point on in the assembly.  .set mipsn 
  4760. affects not only which instructions are permitted, but also how certain macros 
  4761. are expanded. .set mips0 restores the isa level to its original level: either 
  4762. the level you selected with command line options, or the default for your 
  4763. configuration.  You can use this feature to permit specific r4000 instructions 
  4764. while assembling in 32 bit mode.  Use this directive with care! 
  4765.  
  4766. Traditional mips assemblers do not support this directive. 
  4767.  
  4768.  
  4769. ΓòÉΓòÉΓòÉ 23. Acknowledgements ΓòÉΓòÉΓòÉ
  4770.  
  4771. If you have contributed to as and your name isn't listed here, it is not meant 
  4772. as a slight.  We just don't know about it.  Send mail to the maintainer, and 
  4773. we'll correct the situation.  Currently (January 1994), the maintainer is Ken 
  4774. Raeburn (email address raeburn@cygnus.com). 
  4775.  
  4776. Dean Elsner wrote the original gnu assembler for the VAX.(1) 
  4777.  
  4778. Jay Fenlason maintained GAS for a while, adding support for GDB-specific debug 
  4779. information and the 68k series machines, most of the preprocessing pass, and 
  4780. extensive changes in `messages.c', `input-file.c', `write.c'. 
  4781.  
  4782. K. Richard Pixley maintained GAS for a while, adding various enhancements and 
  4783. many bug fixes, including merging support for several processors, breaking GAS 
  4784. up to handle multiple object file format back ends (including heavy rewrite, 
  4785. testing, an integration of the coff and b.out back ends), adding configuration 
  4786. including heavy testing and verification of cross assemblers and file splits 
  4787. and renaming, converted GAS to strictly ANSI C including full prototypes, added 
  4788. support for m680[34]0 and cpu32, did considerable work on i960 including a COFF 
  4789. port (including considerable amounts of reverse engineering), a SPARC opcode 
  4790. file rewrite, DECstation, rs6000, and hp300hpux host ports, updated ``know'' 
  4791. assertions and made them work, much other reorganization, cleanup, and lint. 
  4792.  
  4793. Ken Raeburn wrote the high-level BFD interface code to replace most of the code 
  4794. in format-specific I/O modules. 
  4795.  
  4796. The original VMS support was contributed by David L. Kashtan.  Eric Youngdale 
  4797. has done much work with it since. 
  4798.  
  4799. The Intel 80386 machine description was written by Eliot Dresselhaus. 
  4800.  
  4801. Minh Tran-Le at IntelliCorp contributed some AIX 386 support. 
  4802.  
  4803. The Motorola 88k machine description was contributed by Devon Bowen of Buffalo 
  4804. University and Torbjorn Granlund of the Swedish Institute of Computer Science. 
  4805.  
  4806. Keith Knowles at the Open Software Foundation wrote the original MIPS back end 
  4807. (`tc-mips.c', `tc-mips.h'), and contributed Rose format support (which hasn't 
  4808. been merged in yet).  Ralph Campbell worked with the MIPS code to support a.out 
  4809. format. 
  4810.  
  4811. Support for the Zilog Z8k and Hitachi H8/300 and H8/500 processors (tc-z8k, 
  4812. tc-h8300, tc-h8500), and IEEE 695 object file format (obj-ieee), was written by 
  4813. Steve Chamberlain of Cygnus Support.  Steve also modified the COFF back end to 
  4814. use BFD for some low-level operations, for use with the H8/300 and AMD 29k 
  4815. targets. 
  4816.  
  4817. John Gilmore built the AMD 29000 support, added .include support, and 
  4818. simplified the configuration of which versions accept which directives.  He 
  4819. updated the 68k machine description so that Motorola's opcodes always produced 
  4820. fixed-size instructions (e.g. jsr), while synthetic instructions remained 
  4821. shrinkable (jbsr).  John fixed many bugs, including true tested 
  4822. cross-compilation support, and one bug in relaxation that took a week and 
  4823. required the proverbial one-bit fix. 
  4824.  
  4825. Ian Lance Taylor of Cygnus Support merged the Motorola and MIT syntax for the 
  4826. 68k, completed support for some COFF targets (68k, i386 SVR3, and SCO Unix), 
  4827. added support for MIPS ECOFF and ELF targets, and made a few other minor 
  4828. patches. 
  4829.  
  4830. Steve Chamberlain made as able to generate listings. 
  4831.  
  4832. Hewlett-Packard contributed support for the HP9000/300. 
  4833.  
  4834. Jeff Law wrote GAS and BFD support for the native HPPA object format (SOM) 
  4835. along with a fairly extensive HPPA testsuite (for both SOM and ELF object 
  4836. formats).  This work was supported by both the Center for Software Science at 
  4837. the University of Utah and Cygnus Support. 
  4838.  
  4839. Support for ELF format files has been worked on by Mark Eichin of Cygnus 
  4840. Support (original, incomplete implementation for SPARC), Pete Hoogenboom and 
  4841. Jeff Law at the University of Utah (HPPA mainly), Michael Meissner of the Open 
  4842. Software Foundation (i386 mainly), and Ken Raeburn of Cygnus Support (sparc, 
  4843. and some initial 64-bit support). 
  4844.  
  4845. Several engineers at Cygnus Support have also provided many small bug fixes and 
  4846. configuration enhancements. 
  4847.  
  4848. Many others have contributed large or small bugfixes and enhancements.  If you 
  4849. have contributed significant work and are not mentioned on this list, and want 
  4850. to be, let us know.  Some of the history has been lost; we are not 
  4851. intentionally leaving anyone out. 
  4852.  
  4853.  
  4854. ΓòÉΓòÉΓòÉ 24. Index ΓòÉΓòÉΓòÉ
  4855.  
  4856. Sorry, no cp index 
  4857.  
  4858.  
  4859. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  4860.  
  4861. Any more